Reputation: 5
I have variables age
(beginning from 65
) and female
(1
if female and 0
if male) in my dataset.
How can I test if being male has the same effect as aging 10
years on the total health expenditure?
I have written something like this, which is probably incorrect:
regress totexp age female
test i0.female = age / 10
A reproducible example using Stata's auto
toy dataset is the following:
sysuse auto
regress price i.foreign mpg
test i0foreign = mpg / 10
Upvotes: 0
Views: 506
Reputation: 9470
You can try something along the following lines:
regress price i.foreign c.mpg
lincom _b[1.foreign] - (_b[mpg] / 25)
test _b[1.foreign] = (_b[mpg] / 25)
Note that 25
is an arbitrary number to illustrate the idea. You can also divide age by 10
before fitting the regression to put it into decades. In addition, you probably want to multiply rather than divide in your original example if age is measured in years.
Upvotes: 1