# What statistical test to use to examine effect of condition on states over time?

I need to know the types of tests I need to be thinking about for this stats project. I will then go and look up the specific tests you recommend. The data is from all 50 states for the years 1960-2010.

I think the best way to illustrate the data is to show an example (I just made up numbers):

State           Condition       Score
Alabama1995     Condition 1     .534
Alabama1996     Condition 1     .343
Alabama1997     Condition 1     .545
Alabama1998     Condition 2      NA
Alabama1999     Condition 2     .344
....
....
Maine1995       Condition 3     .343
Maine1996       Condition 3     .342
Maine1997       Condition 3     .543
Maine1998       Condition 1     .439


So what I want to know is if the conditions and scores are statistically different. Do states when under condition 3 have a significant difference from states when under 2 or 1?

Let's say a state in a given year was either condition 1, 2, 3.

Not all states could have a score computed for them, but most did.

I want to evaluate the following types of things:

• What is the relationship between conditions and scores?
• What is the relationship between time and conditions and scores?
• When a state changed from condition 1 to condition 2, was the change in score significant?
• Does condition 1 overall have a higher/lower score than other conditions?

Are there other things besides simple significance tests I should be thinking about?

Ideally something that R (Rcmdr!) can do nicely. Stata, SPSS are also available to me.

-

If you are doing simple regression, you will run into some problem with your standard errors because the readings of different year within the same state is likely to be correlated.

You may want to use multilevel model for your data. Anyway, you may first break off the year into another column before doing your analysis and let it start from 0 for 1995 for easier interpretation. A basic one should look something like this:

lmer(Score~Time+as.factor(Condition)+(1|State))


or if time is of interest,

lmer(Score~Time+as.factor(Condition)+(Time|State))


Then you can test around for linearity, interaction, the usual type of tests you would do for any models. The coefficients should answer your questions.

-
I was wondering if you could explain further your first statement about the simple regression and the usage of multilevel models – dassouki Oct 20 '11 at 19:25
Simple regression is like treating each record as independent. In that case, the sample size would be exaggerated since the records within the same state are possibly correlated. A multilevel model introduce a random random effect that allows each state to be different. It is also known by a couple of different names though, random/varying intercept model; mixed effects model. Hope this helps. – King Oct 20 '11 at 20:07
Thank you all very much! – DSG Oct 24 '11 at 1:20