Thanx for your response,
yeah, i know i didnst specified the indexes
when i wrote the 2nd mail, in fact in the 1st mail i wrote already that
i dont have problem with the estimation of the model... thats the
reason why i didnt write in fact since the issue is not to estimate the
model but to get the marginal effect,
anyway, i figured out that predict(), doesnt work for panel data...
and
well, my problem is that contrary to your guess, i couldnt figure out
the rest of the calculations... since i am not that experienced in R.
one last help of yours would be quite helpful to get rid of this silly problem!
Thanx again...
> Date: Wed, 9 Jun 2010 12:40:42 +0200
> Subject: Re: [R] equivalent of stata command in Râ
> From: jorism...@gmail.com
> To: saint-fi...@hotmail.com
> CC: r-help@r-project.org
>
> plm does not have a predict function, so forget my former mail. To get
> to the coefficients, you just :
> coef(mdl)
>
> The rest of the calculations you can figure out I guess.
>
> I'm also not sure if you're doing what you think you're doing. You
> never specified the index stno in your pml call. Read the help files
> again. And while you're at it, read the posting guide for the list as
> well:
> http://www.R-project.org/posting-guide.html
>
> Cheers
> Joris
>
>
> On Wed, Jun 9, 2010 at 11:54 AM, mike mick wrote:
> >
> >
> >
> >
> >
> >
> >
> >
> > From: saint-fi...@hotmail.com
> > To: saint-fi...@hotmail.com
> > Subject: RE:
> > Date: Wed, 9 Jun 2010 09:53:20 +
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > OK! sorry thats my fault,
> >
> > here the translations of the stata commands
> > 1st step is to get the mean values of the variables, well that doesnt need
> > explanation i guess,
> >
> > 2nd step is to estimate the model on panel data estimation method
> > which is:
> > mdl<-plm(lnLP~lnC+lnL+lnM+lnE+Eco+Inno+Eco*Inno+Eco*lnM+Eco*lnE+year,data=newdata,model="within")
>
> and basically i need to get the marginal effect of variable "Eco"
at the sample mean (step 3) but i am not that good in R so any
additional help is wlcome!
> > Thanks
> > From: saint-fi...@hotmail.com
> > To: r-help@r-project.org
> > Subject:
> > Date: Wed, 9 Jun 2010 09:45:16 +
> >
> >
> >
> >
> >
> >
> >
> > It helps if you translate the Stata commands. Not everybody is fluent
> > in those. It would even help more if you would enlight us about the
> > function you used to fit the model. Getting the marginal effects is
> > not that hard at all, but how depends a bit on the function you used
> > to estimate the model.
> >
> > You can try
> > predict(your_model,type="terms",terms="the_term_you're_interested_in")
> >
> > For exact information, look at the respective predict function, eg if
> > you use lme, do ?predict.lme
> > Be aware of the fact that R normally choses the correct predict
> > function without you having to specify it. predict() works for most
> > model objects. Yet, depending on the model eacht predict function can
> > have different options or different functionality. That information is
> > in the help files of the specific function.
> >
> > Cheers
> > Joris
> >
> > Dear all,
> >
>
> I need to use R for one estimation, and i have readily available
stata command, but i need also the R version of the same command.
> > the estimation in stata is as following:
> > 1. Compute mean values of relevant variables
> >
> >
> >
> > . sum inno lnE lnM
> >
> >
> >
> >Variable | ObsMeanStd. Dev. MinMax
> >
> > -+
> >
> >inno |146574.0880374.2833503 0 1
> >
> > lnE |146353.92562391.732912 -4.473922 10.51298
> >
> > lnM |1462094.2819031.862192 -4.847253 13.71969
> >
> >
> >
> >2. Estimate model
> >
> >
> >
> > . xi: xtreg lnLP lnC lnL lnE lnM eco inno eco_inno eco_lnE eco_lnM i.year,
> > fe i(stno)
> >
> > i.year_Iyear_1997-1999(naturally coded; _Iyear_1997 omitted)
> >
> >
> >
> > Fixed-effects (within) regression Number of obs =
> > 146167
> >
> > Group variable (i): stnoNumber of groups =
> > 48855
> >
> >
> >
> > R-sq: within = 0.9908 Obs per group: min =
> > 1
> >
> > between = 0.9122avg =
> > 3.0
> >
> > overall = 0.9635max =
> > 3
> >
> >
> >
> >F(11,97301)=
> > 949024.29
> >
> > corr(u_i, Xb) = 0.2166 Prob > F =
> > 0.
> >
> >
> >
> > --
> >
> >lnLP | Coef. Std. Err. tP>|t| [95% Conf.
> > Interval]
> >
> > -+
> >
> > lnC | .