Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Olivia Bacha <oliviabacha@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: AW: nlcom |
Date | Tue, 15 Jun 2010 01:17:02 -0300 |
Martin, Stata is showing syntax error. Variable I want to compute marginal effects is a proportion of expenditures (candidate i expenditure / sum of expenditures of all candidates), I want to know the effects in probability of win an election given changes in candidate spending in campaign, as well as given changes in some challenger spending. Thank you very much for your help. Olivia 2010/6/14 Martin Weiss <martin.weiss1@gmx.de>: > > <> > > > > Marginal effects are best estimated using -margins-. What is your reason for > not using it? > > What is the error description (the code number is not that informative)? > > If you want -quietly- and the -r(mean)- returned value, you can also use the > -meanonly- option of -summ-. > > > > HTH > Martin > > > -----Ursprüngliche Nachricht----- > Von: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Olivia Bacha > Gesendet: Montag, 14. Juni 2010 06:15 > An: statalist@hsphsun2.harvard.edu > Betreff: st: nlcom > > Dear all, > > I am running the following code after logit estimation using nlcom, > this is to estimate marginal effects. > > > quietly sum gastos > local gastosM= r(mean) > > quietly sum var60 > local var60M= r(mean) > > quietly sum gastopc > local gastopcM= r(mean) > > quietly sum gastopcreeleição > local gastopcreeleiçãoM=r(mean) > > quietly sum Idade > local IdadeM=r(mean) > > quietly sum qualidade > local qualidadeM=r(mean) > > quietly sum qtpart > local qtpartM=r(mean) > > quietly sum educ > local educM=r(mean) > > local xb1 _b[prop_gasto]*(`gastosM'/`var60M') + _b[gastopc]*`gastopcM' > + _b[reeleição] + _b[gastopcreeleição]*`gastopcreeleiçãoM' + > _b[Idade]*`IdadeM' + _b[qualidade]*`qualidadeM' + _b[qtpart]*`qtpartM' > + _b[educ]*`educM' > > > local xb0 _b[prop_gasto]*(`gastosM'/`var60M') + _b[gastopc]*`gastopcM' > + _b[Idade]*`IdadeM' + _b[qualidade]*`qualidadeM' + > _b[qtpart]*`qtpartM' + _b[educ]*`educM' > > > > nlcom (a1:(1/(1+ exp(`xb1')))^2) (a2:(`var60M' - `gastosM')/`var60M'^2), > post > > nlcom _b[a1] * _b[prop_gasto] * _b[a2] > > > nlcom (-1) * ((1/(1+ exp(`xb0'))) ^2) * _b[prop_gasto] * (`var60M' - > `gastosM')/`var60M'^2 > > > nlcom ((1/(1+ exp(xb1))) ^2) * _b[prop_gasto] * (1/`var60M')^2 * `gastosM' > > > Stata is returning error 198 when i start using nlcom. What's my mistake? > > Thank you very much in advance. > > Regards, > > Olivia > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/