This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Frisch-Waugh-Lovell Theorem. | |
In a multiple regression, the effect of any single covariate can be obtained | |
by removing the effects of the other covariates from both the dependent and | |
independent variables. | |
""" | |
import numpy as np | |
import statsmodels.api as sm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MonkeyOpen(pysal.IOHandlers.gal.GalIO): | |
FORMATS = ['gal'] | |
MODES = ['r', 'w'] | |
def __init__(self, *args, **kwargs): | |
self._typ = str | |
pysal.core.FileIO.FileIO.__init__(self, *args, **kwargs) | |
self.file = urlopen(self.dataPath) | |
@staticmethod | |
def getType(*args, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def wide_to_long(df, stubnames, i, j): | |
""" | |
User-friendly wide panel to long format. | |
Parameters | |
---------- | |
df : DataFrame | |
The wide-format DataFrame | |
stubnames : list | |
A list of stub names. The wide format variables are assumed to |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 25 columns, instead of 12. in line 5.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CUSIP,ARDSSIC,SCISECT,LOGK,SUMPAT,LOGR70,LOGR71,LOGR72,LOGR73,LOGR74,LOGR75,LOGR76,LOGR77,LOGR78,LOGR79,PAT70,PAT71,PAT72,PAT73,PAT74,PAT75,PAT76,PAT77,PAT78,PAT79 | |
800,15,0,6.08360,354.00000,0.99684,0.88311,0.94196,1.06678,1.02901,0.92327,1.02309,0.97240,1.09500,1.07624,30.00000,28.00000,22.00000,34.00000,31.00000,32.00000,41.00000,60.00000,57.00000,77.00000 | |
1030,14,1,1.97492,13.00000,-0.45815,-0.21637,0.08434,-0.15087,-0.68464,-1.48519,-1.19495,-0.60968,-0.58082,-0.60915,3.00000,1.00000,2.00000,1.00000,2.00000,3.00000,2.00000,1.00000,1.00000,1.00000 | |
2824,4,1,5.64899,493.00000,3.39054,3.40697,3.44199,3.52962,3.58542,3.67343,3.77871,3.82205,3.88021,3.90665,48.00000,43.00000,61.00000,63.00000,58.00000,49.00000,42.00000,63.00000,77.00000,80.00000 | |
4644,13,0,0.68377,2.00000,0.54340,0.48454,0.58779,0.48840,0.53714,0.43436,0.33836,0.36561,0.43860,0.42459,1.00000,0.00000,0.00000,1.00000,0.00000,0.00000,0.00000,1.00000,0.00000,0.00000 | |
7842,16,0,2.06433,12.00000,0.39511,-0.88895,-0.31471,-0.21752,-0.36157,-1.29773,-1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy import special, stats | |
from statsmodels.base.model import GenericLikelihoodModel | |
def vuong_test(p1, p2): | |
r""" | |
Vuong-test for non-nested models. | |
Parameters | |
---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set more off | |
capture program drop ZIP_FE_model | |
program define ZIP_FE_model | |
version 9.1 | |
args todo b lnf | |
tempvar theta1 lambda last nonz w sln0 sln r0 r nb0 nb1 nb00 nb2 L2 | |
local by "$MY_panel" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
County | X | Y | Rate | |
---|---|---|---|---|
Alameda | 195 | 500 | 14.4 | |
Alpine | 318 | 560 | 0.0 | |
Amador | 265 | 550 | 12.1 | |
Butte | 220 | 630 | 52.9 | |
Calaveras | 280 | 530 | 22.6 | |
Colusa | 195 | 598 | 23.8 | |
Contra Costa | 192 | 515 | 12.5 | |
Del Norte | 100 | 790 | 301.5 | |
El Dorado | 260 | 580 | 32.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATE=`date -d "now + 23 hour + 0 min + 0 sec" +%s` | |
rtcwake -lv -m disk -t $DATE | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ..='cd ..' | |
alias ...='cd ../../../' | |
alias ....='cd ../../../../' | |
alias .....='cd ../../../../../;' | |
alias c='clear' | |
alias ping='ping -c 5' | |
alias ports='netstat -tulanp' | |
alias apt-get="sudo apt-get" | |
## pass options to free ## | |
alias meminfo='free -m -l -t' |