[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Outreg margins error
John Luke Gallup <firstname.lastname@example.org>
Re: st: Outreg margins error
Thu, 6 Sep 2012 19:17:53 -0700
If you were using a nonlinear regression method instead of -regress-, I would think you would want to use the following -margins- command since you don't seem interested in factor variable interactions:
As it is, in OLS the marginal effects are identical to the coefficients.
By the way, -outreg- is now updated on SSC resolving the bug that you identified.
On Sep 6, 2012, at 8:20 AM, Nick Cox <email@example.com> wrote:
> I don't think you are understanding what -margins- does. Look at the
> help and you will see that it starts
> margins [marginlist] [if] [in] [weight] [, response_options options]
> where marginlist is a list of factor variables or interactions that appear
> in the current estimation results.
> So, you are offering
> tfhhh shg lntotalexp ...
> to -margins- as a marginslist. My interpretation is that -margins- is
> happy to accept -tfhhh shg-, whatever they are, as part of a
> marginslist but bails out because -lntotalexp- is certainly not
> Otherwise put, it's not enough that your syntax looks like what
> Carsten was using as an example. It must also make sense to -margins.
> Also, you really must read the help!
> On Thu, Sep 6, 2012 at 4:08 PM, Wameq Raza <firstname.lastname@example.org> wrote:
>> Dear Nick,
>> Thanks for the response. Yes, the lntotalexp is the natural log of
>> expenditure. My syntax was:
>> margins tfhhh shg lntotalexp lnhhsize fem0to13 fem36to55 fem55
>> men0to13 men14to35 men36to55 men55 eduprim_hh edumid ///
>> _hh eduhigh_hh scst dumemp_hh2 dumemp_hh3 dumemp_hh4 dumemp_hh5
>> dumemp_hh6 kanpur allahabad aillness1 aillness2 ail ///
>> lness4 aillness5, post
>> lntotalexp: factor variables may not contain noninteger values
>> Hopefully this syntax is correct following the previous response from
>> Carsten. I've also tried getting the margins using the same syntax
>> one variable at a time, but to no avail. Any suggestions?
>> On Thu, Sep 6, 2012 at 2:02 PM, Nick Cox <email@example.com> wrote:
>>> My suggestions are:
>>> 1. The error means what it says: -lntotalexp- (presumably the log of
>>> total expenditure) cannot be a factor variable.
>>> 2. The error arises from incorrect syntax, but you need to show us
>>> _exactly_ what you typed with your data.
>>> 3. For "STATA" read "Stata" throughout.
>>> 4. Points 2 and 3 are covered by the Statalist FAQ, so you really
>>> should read that before re-posting.
>>> On Thu, Sep 6, 2012 at 11:01 AM, Wameq Raza <firstname.lastname@example.org> wrote:
>>>> Dear Carsten and John,
>>>> Thank you so very much for the replies. As for the syntax Carsten
>>>> suggested, STATA gives me an error when estimating continuous
>>>> variables such as the ln of expenditures. The error message it gives
>>>> me is:
>>>> -lntotalexp: factor variables may not contain noninteger values-
>>>> Any suggestions for this?
>>> * 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/
>> W A M E Q R A Z A
>> * 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: