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?

  • $\begingroup$ 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? $\endgroup$ – Maarten Buis Sep 19 '14 at 11:44
  • $\begingroup$ 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 $\endgroup$ – 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.

n <- 100; set.seed(1)
sex <- sample(c('female', 'male'), n, TRUE)
sibs <- sample(0:7, n, TRUE)
age <- rnorm(n, 40, 10)
dd <- datadist(sex, sibs, age); options(datadist='dd')
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.

  • $\begingroup$ I don't really understand this $\endgroup$ – Amber Sep 19 '14 at 13:34
  • $\begingroup$ 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. $\endgroup$ – Frank Harrell Sep 19 '14 at 13:46
  • $\begingroup$ 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. $\endgroup$ – Amber Sep 19 '14 at 14:31
  • $\begingroup$ 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. $\endgroup$ – Frank Harrell Sep 19 '14 at 14:41
  • $\begingroup$ 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? $\endgroup$ – Amber Sep 19 '14 at 14:52

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.