This is likely a basic problem but as a non-statistician I don't know how to formulate it or where to start with the analysis.

I have (paired) observations for individuals in two conditions. Each observation is 10 data points. The independent variable $x_i$ ranges from 0 to 10 for each individual and the dependent variable $y_i \in \mathbb{R_+}$. So for each individual I have 20 data points, 10 in each condition. I expect that $y_i$ varies as a quadratic function in $x_i$ for each individual, however: (a) the responses are noisy, and (b) I expect the coefficients of the quadratic to be different for each individual.

I would like to:

  • Independently fit a quadratic model to each individual in each condition and analyze the goodness of fit ($R^2$) per individual. I would like to report some kind of summary statistic as evidence that a quadratic model is appropriate for our setting; however, I don't know what to report. The average $R^2$ value doesn't seem right. How can one report this type of statistic when I expect the true coefficients to differ between individuals (so fitting a single, aggregate model is not a good option)?
  • Compare the model fits between conditions to understand if there is a significant change per individual between conditions. For this point, my thought was to fit a quadratic to the difference in observations between the conditions and then perform a significance test (Wald test?) to see if the coefficients are greater than 0. However, I'm not sure if I need to take into account that some individuals may fit the quadratic model better than others. What is an appropriate way to test this difference?

I would appreciate any suggestions on how to address these two questions.


1 Answer 1


Perhaps a mixed linear model on subject ID with random intercept, linear and quadratic effects for $x_i$ would best fit your data. If one does not wish to measure the variation through variance parameters, but wishes to encode the variation in the mean function, you can create a factor variable for subject ID, call it $z_i$, and create interaction variables with $x_i$ that will force each subject to have a different set of quadratic coefficients. This full model will give you 1 measure of $R^2$ which you can interpret normally. You should also make sure that the individual quadratic models have significant coefficients.

For your second question, you could reformulate it as: Is there a statistically significant difference in the mean value of the response variable when the condition $x_i = c$ between subject $i$ and subject $j$? In this case one makes assumptions about independence between subjects and homogeneity of variances, computes a point estimate of the mean value for the the two subjects at condition $c$, and computes a $t$ statistic to test that the difference is significantly different than 0. You may extend this by constructing a confidence band through Scheffe's method and have this interpretation at all conditions.

  • $\begingroup$ Thanks, this helps a lot! Regarding the first paragraph "You should also make sure that the individual quadratic models have significant coefficients." what are you suggesting is the hypothesis being tested here for significance? I thought the hypothesis test only comes into play in the second part but maybe I'm wrong. $\endgroup$
    – user219923
    Nov 20, 2021 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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