Chang ,JX

рассказ и язык

Archive for June, 2008

data management in household data

Posted by changjx on June 27, 2008

#stata
cd “c:\data\”
reserve
keep id itm* amt*
outsheet using “c:\data\inc95t.txt”,comma
restore
Read the rest of this entry »

Posted in EconStatistics, Stata | Tagged: , | Leave a Comment »

probit ml in stata and R

Posted by changjx on June 24, 2008

/* Stata */

clear
set obs 1000
gen x=invnorm(uniform())
gen e=invnorm(uniform())
gen y=0.5+0.4*x+e
replace y=0 if y<=0
replace y=1 if y>0
Read the rest of this entry »

Posted in EconStatistics, R, Stata | Tagged: , | Leave a Comment »

ols and probit diff

Posted by changjx on June 22, 2008

n<-10000
disper<-0.6
x<-rnorm(n)
e<-rnorm(n,disper)
a<-0.3;b<-0.6;
y<-a+b*x+e
y<-ifelse(y<0,0,1)
g<-y~x
summary(lm(g))
summary(glm(g,family=binomial(link=probit)))

Title:
Results on the bias and inconsistency of ordinary least squares for the linear probability model

Author
William C. Horracea, and Ronald L. Oaxacab

Limitations of the Linear Probability Model (LPM) are well-known. OLS estimated probabilities are not bounded on the unit interval, and OLS estimation implies that heteroscedasticity exists. Conventional advice points to probit or logit as the standard remedy, which bound the maximum likelihood estimated probabilities on the unit interval. However, the fact that consistent estimation of the LPM may be difficult does not imply that either probit or logit is the correct specification of the probability model; it may be reasonable to assume that probabilities are generated from bounded linear decision rules. Theoretical rationalizations for the LPM are in Rosenthal (1989) and Heckman and Snyder (1977).

Despite the attractiveness of logit and probit for estimating binary dependent variable models, OLS on the LPM is still used. Recent applications include Klaassen and Magnus (2001), Bettis and Fairlie (2001), Lukashin (2000), McGarry (2000), Fairlie and Sundstrom (1999), Reiley (2005), and Currie and Gruber (1996). Empirical rationales for the LPM specification are plentiful. McGarry appeals to ease of interpretation of estimated marginal effects, while Reiley cites a perfect correlation problem associated with the probit model. Fairlie and Sundstrom prefer LPM because it implies a simple expression for the change in unemployment rate between two censuses. Bettis and Farlie choose LPM because of an extremely large sample size and other simplifications implied by it. Lukashin uses the LPM, because it lends itself to a model selection algorithm based on an adaptive gradient criterion. Currie and Gruber state that logit, probit, and OLS are similar for their data and only report LPM results.

Other rationales for the OLS on the LPM are complications of probit/logit models in certain contexts. Klaassen and Magnus cite panel data complications in their tennis example and select OLS. OLS is perhaps justified in simultaneous equations/instrumental variable methods. The presence of dummy endogenous regressors is problematic if the DGP is assumed to be probit or logit; these problems were first considered by Heckman (1978 ). While perhaps less popular than logit and probit, OLS on the LPM model still finds its way into the literature for various reasons.

Some well-known LPM theorems are provided in Amemiya (1977). Econometrics textbooks (e.g., Greene, 2000), acknowledge complications leading to biased and inconsistent OLS estimates. Nevertheless, the literature is not clear on the precise conditions when OLS is problematic. This note rigorously lays out these conditions, derives the finite-sample and asymptotic biases of OLS, and provides additional results that highlight the appropriateness or inappropriateness of OLS estimation of the LPM. Finally, we suggest a trimmed sample estimator that could reduce OLS bias.

Posted in EconStatistics, R | Tagged: , | Leave a Comment »

hausman test

Posted by changjx on June 18, 2008

xtreg $output $input,fe
estimates store fixed
xtreg $output $input,re
hausman fixed .

Read the rest of this entry »

Posted in Econ, Stata | Tagged: , | Leave a Comment »

yahoo dating and economics

Posted by changjx on June 13, 2008

yahoo is smart in marking,but smarter than facebook? check later on.
i joined the yahooo dating long ago, yet not seriously. nowaday, i
reopened it for some reason.Shakespare said “Brevity is the soul of word”.
–>All in all, it provides all the vanity and
dignity human need to make couple, i think a good topics to research
in prob of logit

Posted in Econ | Tagged: | Leave a Comment »

gen non constant error in regression

Posted by changjx on June 10, 2008

set obs 1000
sca a=2
sca b=2
sca wt=10
gen x=uniform()*100
gen e=invnorm(uniform())
gen y=a+b*x+wt*e
reg y x

Posted in Stata | Tagged: | Leave a Comment »