Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: multiple blocks in stata


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: multiple blocks in stata
Date   Fri, 08 Jul 2005 23:30:37 -0500

At 08:56 PM 7/8/2005 -0700, Mosi A. Ifatunji wrote:
all,

i am a graduate student working on my masters
paper. my advisor is only familiar with spss
while i am using stata for my paper. my question
is how do i ask stata to produce a regression
analysis with multiple models or blocks? that is,
right now i run a different regression for each
block or model and this prduces different Ns for
each model. how do i run a multiple regressions
in one command, adding terms to each model? this
is also refered to a listwise deletion.
One way is to use Paul Bern's -hireg- routine; from within Stata type -findit hireg-. For more info see the following handout, esp. p. 5:

http://www.nd.edu/~rwilliam/stats1/OLS-Stata.pdf

Links to other Stata-related handouts are at

http://www.nd.edu/~rwilliam/stats1/StataHighlights.html

Another, more general strategy is to do something like

. gen touse = !missing(y, x1, x2, x3, x4)
. reg y x1 x2 x3 if touse

The variable touse will be coded 1 if there is no missing data in any of the variables specified; otherwise it will equal 0. The if statement on the reg command will limit the analysis to cases with nonzero values on touse (i.e. the cases with data on all 5 variables). Similar -if- qualifiers could be added to other commands if you want to be analyzing the exact same cases throughout your entire analysis; just make sure that the gen statement for touse includes all your variables that you want to do listwise deletion on.



-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index