Hi,
I am trying to replicate a line of stata code:
logit reelect2 ddef3_n ddef1 gdppc_gr2 dev nd maj, robust;
I am able to get the beta values, but my errors are off. I used both:
mylogit = glm(reelect2 ~ ddef3_n + ddef1 + gdppc_gr2 + dev + nd +
maj, family=binomial(link="logit"), na.action=na.pass)
and
mylogit = zelig(reelect2 ~ ddef3_n + ddef1 + gdppc_gr2 + dev + nd
+ maj, model = "logit", data = data, robust = TRUE)
The first is non-robust but the second is. Anyone have any suggestions
with how to approach this?
Thanks!
Han
Harvard College Class of 2013
614-329-1324
I am having problems accessing the videos for lectures and sections from the past 3 weeks. Is anyone experiencing the same problem?Any suggestion?
Thanks
Chiara
Hi all,
Sometimes when I put pictures into Latex using the Beamer package the file
name of the picture shows up above the picture in the slide show. Does
anyone know why this is happening, and how to make sure the file name
doesn't show up? (If it helps, my code is below.)
Thanks,
Shelby
\frame
{
\begin{figure}[!htp]
\begin{center}
\includegraphics[width = 3.5in, height=2.5in]{Construction.jpg}
\end{center}
\end{figure}
}
Sorry, I have another question: for the draft paper due soon, do we have to
also present our methodological improvements to the paper? Or do we just
have to replicate the numbers and graphs and that's it? Thank you.
Hi All-
I am running into some problems estimating panel-corrected standard errors
with the pcse package. I am using the code:
pcse(se4, countries, years, pairwise=TRUE) where se4 is an lm model,
countries is a vector of country identifiers for each observation in the
dataset, and years is a vector of the year identifiers of all the
observations.
I keep getting the following error:
Error! A CS-unit exists without any obs or without any obs in
common with another CS-unit. You must remove that unit from
the
data passed to pcse().
I have tried to create a new data-frame with only the variables used in the
model, omitted all the rows with missing data, and then used this new data
to estimate the model. I have also tried to omit all the country groupings
that only have one observation and re-run the model, which also doesn't
work. I can get the pcse command to work if I omit any country group with
less than about 10 observations, but the estimates that I get do not match
those in the paper. Also, if I replicate the regression in STATA, the
output says that it uses all countries in the estimation, even those with
only 1 observation. Any ideas?
Also, is there any way to include an AR(1) correction along with panel
corrected standard errors in R? The authors of the paper use the xtpsce
command in STATA with the option correlation(ar1), but I don't think the
pcse package has an option for an AR(1) correction.
Thanks!
Megan Westrum
Hi all,
We are trying to replicate a STATA command that adjusts the standard errors
for within-group correlation (in our case districts). Is there a package
that does lm or ls (from Zelig) that can account for this clustering?
I found a var/cov function online called *robcov*() that apparently does
this but I can't find the package that contains this command.
I have also spent a long time attempting to model this using the nlme
package that allows for hierarchical data structures. I can get my model to
run but I can't get it to give me the correct results. Either I am doing
something wrong in my code or the areg , cluster() command in STATA is doing
something more then including random effects.
my.lme <- lme( y ~ x1 + x2, data=temp , random=~ 1 | district)
Any ideas?
thanks,
m
--
Matthew Kraft
Doctoral Candidate
Quantitative Policy Analysis
Harvard Graduate School of Education
All,
Can anyone recommend a package for R that does multinomial probit models,
and can take into consideration weights and clusters?
We've considered a few functions, but none meet all of these requirements.
Zelig's "probit.survey" handles weights and clusters, but only deals with
dichotomous dependent variables. The MNP package and Zelig's "oprobit"
package deal with multinomial dependent variables but--as far as we can
tell--not weights and clusters.
Thanks,
Amanda and Shelby
>From the lectures, each time we have specified a systematic component, the
parameters of the model (eg mu, sigma, pi or otherwise) have been assumed to
vary according to a linear combination of independent variables.
For example, with the logit model, the systematic component is pi = 1/(1 +
exp(X*beta)). The X*beta has so far always been a linear expression.
Is this just for teaching purposes? Presumably it does not have to be linear
at all: to model interaction effects you would need a non-linear expression
or you might expect model parameters to vary according to X^2 or something
more exotic? Would the form of the X*beta expression you choose have
implications for the type of systematic component you able to use (eg would
the choice of logit restrict your choice of X*beta expression)?
Nicola
Hey all,
So I finally managed to get all my coefficients correct (on one model) but
the t-statistics are supposed to be robust (to what I don't know). Any clue
on how I get robust t-statistics in R.
-Ashley Anderson