I am looking at one kind of measurement in 4 groups Young males, young females, senior males, senior females. Whereas I am mainly concerned at looking at the differences between young and old, I don't want sex as a confounding factor which is why I added in the additional sex groups and basically doubled my sample size (no previous studies to say if it is different with age in the species I am researching). I am pretty new to statistics and am not sure how to analyse this as I was originally going to do a student's unpaired T-Test but now I have added the additional two groups to separate the sexes.

Additionally, some of the patients I am using may have underlying health issues that impact the measurement I am taking. I know this in advance (so for example I might know that 2 of the 12 senior females may have a health problem that changes the measurement), but unfortunately I cannot choose a different group of patients. Is there a way to account for these in advance? Or to note which ones may have values indicative of health problems and treat them as outliers later.

So without changing the outline of the project, if I am mainly comparing differences in this measurement between two age groups, while also taking into account sex, what statistical test should I use?

Thank you

  • $\begingroup$ This is an RBD. where the sexis your block. so an anova would suffice $\endgroup$
    – Onyambu
    Mar 29, 2023 at 2:35
  • $\begingroup$ By analyzing age groups and not continuous age, the result will be highly inefficient and possibly misleading. See discourse.datamethods.org/t/categorizing-continuous-variables. There is great heterogeneity within an age "group". $\endgroup$ Mar 29, 2023 at 17:03
  • $\begingroup$ @FrankHarrell I was originally looking between the two, but there is a large age gap I am missing as for this initial study I am only looking at two age groups (1-3 and 10+ in animals where lifespan is only max 15 years). The question I am trying to answer is just if there is a difference between the two age groups and if there is my next study would be using animals with continuous age to see where that change may occur. Our hypothesis is that said change happens before the age of ten so there should be significant differences between the two vastly different groups- would you still be wary? $\endgroup$
    – Kimber
    Mar 30, 2023 at 21:38
  • $\begingroup$ You can have age gaps and still get a much better analysis by using exact age. $\endgroup$ Mar 31, 2023 at 17:56
  • $\begingroup$ @FrankHarrell Okay thank you! If all I need to do is change how I analyse the data from these two age groups I will look into analysing them as continuous data rather than groups- would that change the method I analyse it or could I still do a linear regression but specify exact ages instead of young adult or senior? $\endgroup$
    – Kimber
    Apr 2, 2023 at 23:26

1 Answer 1


This would be a linear regression. Your measurement is the outcome (called "Y"), sex, and any other variable (such as the other health conditions you mentioned) are the predictors (called "X" variables). Variables other than age would also be called "covariates". This would allow you to test the relationship between age and your outcome, while adjusting for sex and health conditions.


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.