1
$\begingroup$

I have data on age, gender and weights of children. For example:

    Males       Females 
age mean_wt se  mean_wt se
1   4       0.2  5.3    0.2
2   5       0.3  6.2    0.3
3   6       0.4  7.1    0.2
4   7       0.5  8.2    0.5
5   8       0.1  9.1    0.6

I can apply t-test to determine if weights of males and females are different from each other. But if I plot 2 curves (one each for males and females) of age vs weight, how can I determine if the two curves are significantly different from each other?

enter image description here

How can I determine if above two curves are significantly different from each other? Thanks for your help.

Edit:

Following is the output of regression in R:

summary(lm(y~age+gender+age*gender, data=mydata)

Residuals:
    Min      1Q  Median      3Q     Max 
-46.189  -7.294  -0.189   7.560  62.560 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept) 92.68525    0.72402 128.016  < 2e-16
age          1.56090    0.06661  23.432  < 2e-16
genderM      2.83605    0.95037   2.984  0.00285
age:genderM -0.35239    0.08717  -4.043 5.34e-05

Residual standard error: 10.93 on 8113 degrees of freedom
  (55 observations deleted due to missingness)
Multiple R-squared:  0.1118,    Adjusted R-squared:  0.1114 
F-statistic: 340.3 on 3 and 8113 DF,  p-value: < 2.2e-16

I believe it means that there is significant interaction between age and gender and hence the curves for males and females for y vs age are significantly different. Is this right? Is this the best method or is there any other method? Also adjusted R-squared is only 0.11. Does this mean that 89% of variability is not being explained by age and gender?

I see that centering is highly recommended: http://www.ncbi.nlm.nih.gov/pubmed/15297898

Will centering affect P values? Should I center age? Should I convert gender into numeric values or should I let it be 'M' and 'F' and let R software manage it. If I convert it into numbers, should I convert to 0/1 or to 1/2? I thought all binar factors should be converted to 0/1 since that will show the effect more clearly but the article recommends 1/2.

$\endgroup$
1
$\begingroup$

It would help if you explained the data a little bit. It looks like what you have in the table and graph are aggregate numbers of raw data, and it looks like your estimates are regression estimates of some sort, which explains their linearity.

If my assumptions are correct, what you are trying to do is estimate whether the slope on Age is the same for males vs females. That can be done a number of different ways in a regression, for example: - Create an interaction term between gender and age - Run the model for males and females separately and test their coefficients (a joint F test or a likelihood ratio test, for example)

If you are using Stata, for example, you could do:

reg wt c.age#female

or you could use suest:

eststo est_fem: quietly reg wt age if female==1
eststo est_male: quietly reg wt age if female==0
suest est_fem est_male
test [est_fem_mean]age==[est_male_mean]age

Now, this could get more complex if your children are nested within families, where you may need to take account of the multilevel structure. If that's the case, you need either to use cluster-robust standard errors, or decide on a random effects model...

EDIT based on your added questions regarding dummy coding: Different dummy coding doesn't matter. R can interpret factor variables logical variables or numerical variables as dummies so it doesn't matter if you call gender m/f, 0/1, 1/2.

$\endgroup$
  • $\begingroup$ Thanks for your answer. I have original data (column headings: subjectID age gender weight) but in the table above I have just shown means and standard errors and plotted that in graph. This is example data only and the linearity is just because I put simple values there. I am using R for analysis but I want to know the methods in whichever language. $\endgroup$ – rnso Dec 3 '14 at 4:13
  • 1
    $\begingroup$ In R you would do a similar thing, using lm: lm(y~age+gender+age*gender). Look at the significance of the interaction term, that's the fastest way (not always the best, but fastest). $\endgroup$ – robin.datadrivers Dec 3 '14 at 6:24
  • $\begingroup$ I have added the result of lm in my answer above. Please give your opinion. $\endgroup$ – rnso Dec 3 '14 at 9:09
  • 1
    $\begingroup$ Don't worry about R2 - with only 2 variables, unless the relationship is really direct I wouldn't expect you to explain all the variance. Particularly in determining weight. Your interpretation of the interaction is correct - the slopes are different between men and women. The intercept is a little weird - how is age measured? Is it centered? The intercept literally means here, the average age of women who have 0 years of age...that can't possibly be 92. BTW, what is the unit of weight? lbs or kg? $\endgroup$ – robin.datadrivers Dec 3 '14 at 17:34
  • $\begingroup$ This is not example data and y here is not weight but some other complex health parameter, for which the intercept may be 92 units. Thanks for explaining that intercept is basic y value and not a coefficient to be compared with others. Age is actual age and not centered. Please see my edit regarding issue of centering here. $\endgroup$ – rnso Dec 4 '14 at 0:38

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.