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: Looping with regression controls


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Looping with regression controls
Date   Thu, 1 Mar 2012 00:29:51 +0000

Your two commands fit the same model. The order of predictors affects
only the presentation of results.

Nick

On Wed, Feb 29, 2012 at 10:51 PM, Ras Dondo <[email protected]> wrote:

> I am new to Stata and having difficulty fitting a
> model. I have one dependent variable RECOVER coded 0 or 1. I also have
> 10 independent categorical variables AGE, EDUCATION, RELIGION, MARITAL,
> SOC_CLASS, COUNTRY_BIRTH, EMPLOYMENT, YEARS_WORKED, NO_PARTNERS, and
> FAMILY_SIZE. I wish to model the effect of each sociodemographic
> variable on the dependent variable RECOVER whiles controlling for the
> remaining nine independent variables. First time round I wish to model
> the effect of AGE on RECOVER whiles controlling for the remaining nine
> variables as below.
>
>
> xi: logistic RECOVER i.AGE i.EDUCATION
> i.RELIGION i.MARITAL i.SOC_CLASS i.COUNTRY_BIRTH i.EMPLOYMENT
> i.YEARS_WORKED i.NO_PARTNERS i.FAMILY_SIZE
>
> Second time round I
> will wish to model the effect of EDUCATION on RECOVER whiles controlling
> for the remaining nine variables as below.
>
> xi: logistic RECOVER i.EDUCATION i.RELIGION i.MARITAL i.SOC_CLASS
> i.COUNTRY_BIRTH i.EMPLOYMENT i.YEARS_WORKED i.NO_PARTNERS i.FAMILY_SIZE i.AGE
>
>
> My
> question is instead of repeating the logistic command is it possible to
> write one command maybe using looping that will let me avoid the
> repetition?
>
*
*   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