Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | David Hoaglin <dchoaglin@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: 1-4 scale |
Date | Sat, 4 Aug 2012 15:08:11 -0400 |
Dear Ebru, I did not mean factor analysis. You did not give details of your estimation model (e.g., whether it is a regression model). A number of analysis commands in Stata allow you to use categorical predictors without creating indicator variables for the categories that are not the reference category. For a variable named categ with values 1 to 4 for the 4 categories, and using the first category as the reference category, you could create 0/1 variables categ2, categ3, and categ4 for the non-reference categories and use those in your model. If the command allows factor variables, you can put i.categ in the list of predictor variables and let Stata create indicators for the non-reference categories (internally, for use in the model). Factor variables in Stata have much more flexibility and power than this little example shows. I began to use Stata with version 12, and I don't know which version introduced them. I hope they are available in the version you are using. One way or another, a categorical variable with 4 categories requires 3 coefficients: one for each non-reference category (the reference category is part of the definition of the intercept term). That does not apply if you use the variable as a numerical variable, but then you are assuming that the categories are equally spaced. David Hoaglin On Sat, Aug 4, 2012 at 2:10 PM, Ebru Ozturk <ebru_0512@hotmail.com> wrote: > Dear David, > > Thank you. By a factor variable, do you mean factor analysis? as I didnt understand why the model will have three coefficients. * * 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/