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

# Re: st: Using sampling/probability weights for mixed design ANOVA in STATA

 From Steven Samuels To statalist@hsphsun2.harvard.edu Subject Re: st: Using sampling/probability weights for mixed design ANOVA in STATA Date Tue, 31 May 2011 19:58:28 -0400

```--

Meg, here's an example of how to do an -anova- analysis with a probability weight.  It exploits the fact that -anova- is equivalent to an ordinary multiple regression command (Stata -regress-, for example) and Stata's -regress- _will_ take a probability weight. The trick is to run -regress- without options after -anova-  to show the implied predictors that you need to put on the right hand side of the equation. You will need to prefix the categorical factors with "i.". The example is from the -anova- help illustration of a split-plot design:

*******START******************
log close
log using aovtest, replace text

anova score prog / class|prog skill prog#skill / class#skill|prog / group|class#skill|prog /, dropemptycells
regress   //

//regression equivalent from -regress- statement after -anova-: add the "i." in front of the categorical variables

regress score i.prog i.class#i.prog i.skill i.program#i.skill ///
i.class#i.skill#i.program  i.group#i.class#i.skill#i.program

// regression with probability weight
set seed 4816033
gen finalwt =20*(uniform() +.05)  // weights>1

regress score i.prog i.class#i.prog i.skill i.program#i.skill ///
i.class#i.skill#i.program  i.group#i.class#i.skill#i.program, ///
pweight(finalwt)   // <--pweight option
*********END**************

Meg,
I'm not sure that you should or can do a full-fledged survey analysis,
```