Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: using foreach in regression models


From   Phil Schumm <[email protected]>
To   [email protected]
Subject   Re: st: using foreach in regression models
Date   Tue, 25 Oct 2011 06:07:36 -0500

On Oct 25, 2011, at 5:10 AM, Tim Evans wrote:
> With regards to factor variables - does this only work on numerical values - I've used your code (which incidentally worked fine - thanks for that) but had to generate a new variable for one of my string variables.


Yes, factor variable functionality is restricted to nonnegative integers.  Note, however, that if you have a string variable that is a factor (i.e., with a relatively small number of distinct categories), then it is more efficient to store this as a numeric variable with a corresponding value label.  That efficiency may not matter if your dataset is small, but there are other reasons to prefer numeric variables (e.g., certainly manipulations are easier).


> Why is using -logistic- a better idea than using -logit- with O/R option if they give the same output? 


No major reason, other than it saves you having to use the -or- option (you can always type -logit- after using -logistic- to get the raw coefficients, if necessary).  You are correct that the results are identical.


-- Phil


*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index