Question: Consider a situation in which we know that a linear model is a correct specification for the relationship of interest that includes three variables (Yi,,Xi,Di).

Consider a situation in which we know that a linear model is a correct specification for the relationship of interest that includes three variables (Yi,,Xi,Di). LetYidenote some dependent variable for individuali. LetD i denote the treatment variable. About half of the sample is treated.Di takes on the value of 1 if individuali is treated, and 0 otherwise.LetXi denote a confounding variable for individuali.Xi is a random variable with mean 0 and standard deviation 1. Parenthetically, do not forget to add an error term when you generateYi . The error term also has mean 0 and standard deviation 1. Use R to generate hypothetical data (10,000 observations) from such a model.Do the following three tasks for a situation where there is no treatment effect and a situation where there is a treatment effect so that you will have two figures. Start by writing down the regression equation.

1. show in plot in which the dependent variable is on the y-axis and the confounding variable is on the x-axis.

2. In the plot, make a scatter for individuals in the treatment group and a distinguishable scatter for individuals in the control group.

3. Superimpose a regression linefor individuals in the treatment group and a different regression line for the control group.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!