Date: Tue, 3 Jun 2008 17:34:31 -0500 Robin R High "SAS(r) Discussion" Robin R High Re: How to Set Up Regression Model in SAS? To: Ryan <77a73395-5c92-406f-a4c0-0c7b059179f5@26g2000hsk.googlegroups.com> text/plain; charset="US-ASCII"

Ryan,

It's hard to convince me to analyze means at the state level (level 2) when you have the actual data to work with (level 1). A random coef model in MIXED will compute the mean predicted value for each state, based on the actual (level-1) data as follows:

proc mixed data = indat; class state; model y = x / solution ddfm = contain outpm=yhatm(keep=state pred ); random intercept x / subject = state type = un solution; run;

proc sort data=yhatm; by state;

data yhatm; set yhatm; by state; if first.state; proc print data=yhatm; run;

where y and x are the level-1 (actual data). You can also get the level-1 predicted values with outp=yhat(keep= _____)

Robin High UNMC

Ryan <Ryan.Andrew.Black@GMAIL.COM> Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> 06/03/2008 04:26 PM Please respond to Ryan <Ryan.Andrew.Black@GMAIL.COM>

To SAS-L@LISTSERV.UGA.EDU cc

Subject How to Set Up Regression Model in SAS?

Hi all-

There may be a very easy answer to this, but I just can't seem to figure it out...

I want to test a regression model where the dependent variable is NOT at the "individual" level. I want to create a model to predict, for instance, quality of health (QOH) at the state level, not "individual" level by socio-economic status (SES) at the state level.

Let's say I have data on 20 states, here's what the dataset would look like:

Participant State SES_level_at_subj_level SES_at_state_level QOH_at_subj_level QOH_at_state_level 1 1 24 27.75 56 65.75 2 1 25 27.75 62 65.75 3 1 30 27.75 77 65.75 4 1 32 27.75 68 65.75 . . . . . . . . . . . . . . . . . . 200 20 45 49 55 68.75

where

SES_at_state_level = average SES score of all participants who reside in that state

and

QOH_at_state_level = average quality of health of all participants who reside in that state

-----------------------------------

---So I think my equation would look like this (although I'm sure it's wrong, particularly when calculating df):

QOH_at_state_level = b0 + b1(SES_at_state_level)

---I'm worried that the type I error will be too high when I analyze under OLS---particularly if I have a low number of states (e.g. 10 instead of 20) even though I have 200 participants.

I'd really, really appreciate any help in terms of the SAS syntax or an answer to the statistical issue.

Thanks,

Ryan

PS I have other predictors, but I figured one predictor would be enough to explain the issue

Back to: Top of message | Previous page | Main SAS-L page