# LR test on marginal effect

Say I have the following regression model:

$$\text{Wage}_i = constant + α·\text{YearsOfEduc}_i + β·\text{Age}_i + γ·\text{CompletedHighSchool}_i + \mbox{δ·\text{NumOfSiblings}_i} + ε·\text{Gender}_i + u_i$$

How would I perform an LR test of the hypothesis that the marginal effect of age on the wage for

• a male,
• has two siblings,
• who completed high school,
• has 3 years of education

... is the same as for:

• a female,
• has one sibling,
• who completed high school,
• has 3 years of education.

I can modify the model above if needed, but what would be my unrestricted and restricted models, and how would I use them in a regression?

• The answer is the same as in the previous question you asked: stats.stackexchange.com/questions/115871 So, what did you not understand about the previous answer? – Maarten Buis Sep 19 '14 at 11:44
• I understand the previous answer... but what I don't get about this is now I'm comparing a male who has median siblings vs a female with 1 sibling. So I'm not sure how I would get my UR and R models – Amber Sep 19 '14 at 14:30

Since you are conditioning on a number of variables, what you seem to want is a mixture of a marginal and a conditional (adjusted) effect of sex. I would not know how to interpret such an estimate, as it can be manipulated by oversampling males according to the number of siblings he has, when obtaining the data. You might consider a sequence of conditional estimates. Here is an example in R for a model with three predictors: sex, sibs, and age, with age and number of sibs not assumed to operate linearly.

require(rms)
n <- 100; set.seed(1)
sex <- sample(c('female', 'male'), n, TRUE)
sibs <- sample(0:7, n, TRUE)
age <- rnorm(n, 40, 10)
y <- 3*(sex == 'male') + sibs + .01*(age - 40)^2 + rnorm(n, 0, 4)

f <- ols(y ~ sex + pol(sibs, 2) + rcs(age, 5))
coef(f)['sex=male']  # 2.744
contrast(f, list(sex='male', sibs=0:5),
list(sex='female', sibs=1))

sibs Contrast      S.E.      Lower    Upper    t Pr(>|t|)
0 1.843579 0.9748423 -0.0925419 3.779700 1.89   0.0617
1 2.743908 0.9072221  0.9420867 4.545730 3.02   0.0032
2 3.694806 1.0995190  1.5110664 5.878546 3.36   0.0011
*     3 4.696273 1.2790347  2.1559993 7.236546 3.67   0.0004
*     4 5.748308 1.3630204  3.0412318 8.455384 4.22   0.0001
*     5 6.850912 1.3617277  4.1464032 9.555421 5.03   0.0000

Redundant contrasts are denoted by *

Error d.f.= 92

Confidence intervals are 0.95 individual intervals


Note that when sibs=1 for a male the contrast 2.744 equals the regression coefficient for sex.

If you really want, you can get a weighted average of the conditional estimates according to some reasonable external distribution of sibs to marginalize on sibs. This can be done by specifying type='average', weights=... to contrast. But I would not recommend marginalization.

• I don't really understand this – Amber Sep 19 '14 at 13:34
• Are you understanding what the contrasts are estimating? These are very well-defined conditional quantities. Are you just not understanding why one might do it this way? Please elaborate. – Frank Harrell Sep 19 '14 at 13:46
• This is really beyond me. I have no idea what contrasts and conditional quantities are. All I want to do is a Likelihood Ratio test for the above, and I'm stuck determining the Unrestricted and Restricted model. – Amber Sep 19 '14 at 14:31
• Unless I'm missing something, a likelihood ratio test assumes that you have a very specific hypothesis, and your hypothesis is not well-defined because of incomplete conditioning. There is no unrestricted model for one sex that effectively removes a covariate from the entire modeling process. My suggestion is to work with a statistician. – Frank Harrell Sep 19 '14 at 14:41
• I have updated the conditioning to make it more clearer. Each variable has a conditional value for both cases. Does this help in constructing a UR/R model? – Amber Sep 19 '14 at 14:52