Hi I am new to Stata and have a question regarding using Margins.
I am using a dataset where I have survey data for three time periods on the food intake of individuals in households. I have around 3000 households. Using this data I form a panel dataset where individuals+household is my panel-variable.
I have categorized the individual in the households into 4 groups (male child, female child, men, and women) using their age and gender. My objective is to see the impact of Government Aid and Temperature Deviation on Food Consumption.
For this I estimate a regression using xtreg as below. (Please note that I use several covariates in the regression which I have not mentioned below. I also use time fixed effects)
Regression
Where Consumption is the food consumption of an individual (i) in a household (h) at time period (t).
Aid is a binary variable representing whether the household received government aid in time period t
Temp_deviation is a variable representing whether the household was subject to temperature shocks in time period t. It is a continuous variable that captures only positive temperature deviations and takes the value 0 otherwise.
Code
I want to use marginal effect to test the following
If the impact of Temp_deviation varies across the 4 categories of household members
If the impact of Temp_deviation on the 4 categories of household members is lower in the presence of AID
Margins code
I have two questions
1 - Is my method correct or is there something that i have overlooked in the Margins command
2 - I know that Stata takes partial derivatives for the above margins command (in the rmargins document) but exactly how? Is this interpretation correct?
So for individual 1 the marginal effects of Temperature_deviation will be as
Thanks
I am using a dataset where I have survey data for three time periods on the food intake of individuals in households. I have around 3000 households. Using this data I form a panel dataset where individuals+household is my panel-variable.
I have categorized the individual in the households into 4 groups (male child, female child, men, and women) using their age and gender. My objective is to see the impact of Government Aid and Temperature Deviation on Food Consumption.
For this I estimate a regression using xtreg as below. (Please note that I use several covariates in the regression which I have not mentioned below. I also use time fixed effects)
Regression
Code:
Consumption_iht= B1*Temp_deviation_ht + B2*Individual_iht + B3*Aid_ht + B4*(Temp_deviation_ht *Individual_iht) + B5(Temp_deviation_ht*Individual_iht*Aid_ht) +
Aid is a binary variable representing whether the household received government aid in time period t
Temp_deviation is a variable representing whether the household was subject to temperature shocks in time period t. It is a continuous variable that captures only positive temperature deviations and takes the value 0 otherwise.
Code
Code:
xtreg Consumption c.Temp_deviation i.Individual i.Aid c.Temp_deviation#i.Individual c.Temp_deviation#i.Individual#i.Aid , fe cluster(household)
If the impact of Temp_deviation varies across the 4 categories of household members
If the impact of Temp_deviation on the 4 categories of household members is lower in the presence of AID
Margins code
Code:
margins, dydx(Temp_deviation) at(Individual=(1(1)4) Aid=0) margins, dydx(Temp_deviation) at(Individual=(1(1)4) Aid=1)
1 - Is my method correct or is there something that i have overlooked in the Margins command
2 - I know that Stata takes partial derivatives for the above margins command (in the rmargins document) but exactly how? Is this interpretation correct?
So for individual 1 the marginal effects of Temperature_deviation will be as
Code:
dy(Consumption)/dx(Temp_deviation)=B1 + B4*Individual_1ht + B5*Individual_1ht*Aid_ht