2
$\begingroup$

I have a trial where the measurement is the deviation about a target value.

There are 8 subjects - 4 treatment, 4 control. Each subject has undertaken the trial 4 times. Thus, I have 32 values, nested within groups. Obviously this is a rather small number

Essentially, my treatment is effective if it minimises the absolute values of the deviations (ie 10 above the target value is the same as 10 below).

Can I ask for any suggestions on how this data should be analysed, particularly how I should account for the nesting?

$\endgroup$
2
  • $\begingroup$ My quick suggestion: set the dependent variable as the absolute deviation. Then run a multilevel analysis. A Bayesian hierarchical model can do the job. Try a varying intercept and/ or a varying slope model (sometimes called random effects). I can give more specific advice if you provide more information about what are you looking for: software instruction, how to write the model (in math terms)... $\endgroup$ Commented Nov 15, 2011 at 17:38
  • $\begingroup$ Interesting idea - do you know of any R packages that would handle this? (or SPSS) $\endgroup$
    – argon1024
    Commented Nov 16, 2011 at 0:14

1 Answer 1

2
$\begingroup$

My suggestion (see comment above) is to run a multilevel model. My original answer suggested a Bayesian model. Here I'll provide some code for you do it in r using lme4. It's not fully Bayesian, but its simpler to do.

First, the model: Assuming you have $i = 1, 2, ..., 8$ subjects and $j = 1, 2, ... ,4$ trials, then you can vary by subject or trial. It seems to me that it's more proper to model the subjects response in each trial as correlated, i.e., not independent. So, we will estimate a model that the intercept and slope vary by subject. If the variance among subjects is close enough to zero, then there is no difference among subjects. However, if the variance goes to infinity, then each subject isn't comparable to each other.

$ y_{ij} ~ N(a_{i} + b_{j}*x_{ij}, \sigma^{2})$ $ a_{i} ~ N(\mu.a, \sigma.a^{2})$ $ a_{i} ~ N(\mu.b, \sigma.b^{2})$

Now, the r code. Assuming your data.frame is my.df, and that the dependent variable is y, the treatment is x, and there is a variable subject, just run:

require(lme4)
fit <- lmer(y ~ x + (1|subject) + (0 + x|subject), data=df)
ranef(fit) # this will provide the estimated effect of the varying intercept and varying slope

Note that you don't have standard errors for the random effects, and it's ok. See here:

$\endgroup$
3
  • $\begingroup$ That's really helpful. This is essentially the solution I'd come up with here albeit in SPSS. But no-one in that thread was willing to confirm that I was going down the right path, so I went back to asking for more general advice, which has confirmed what I was thinking. Many thanks! $\endgroup$
    – argon1024
    Commented Nov 16, 2011 at 21:34
  • $\begingroup$ PS What do you think about the suggestion of doing a "non parametric" multilevel model using ranks rather than values; I've read suggestions of this in various places, but nowhere I'd regard as authoritative? $\endgroup$
    – argon1024
    Commented Nov 16, 2011 at 21:37
  • $\begingroup$ I never used any non-parametric model for real (i.e., beyond theoretical classes), so it's beyond my expertise. But my impression is that a non-parametric model is in general more complicated, and I guess so with multilevel models (probably even more complicated). Try with the parametric one and see if it fits the data. If not, then you may think to move on to more complicated things. But, again, I'm no expert on non-parametric stuff. $\endgroup$ Commented Nov 16, 2011 at 23:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.