Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Generate data where selection bias is present using the following code. set.seed(1) n = 1000 error = rnorm(n) x = rnorm(n) t = ifelse(error+x <0,1,0)

Generate data where selection bias is present using the following code. set.seed(1) n = 1000 error = rnorm(n) x = rnorm(n) t = ifelse(error+x<0,1,0) y = 2*t + x + error Here n is the sample size, x is a predictor variable, t is a binary variable that indicates the presence of a treatment, and y is a continuous dependent variable. (a) What is the true value of the treatment effect parameter used to generate your data? (b) In your data, does selection bias overestimate or underestimate the true treatment effect? (c) Explain your answer to part (b) by examining the relationship between the treatment variable and the error term. (Hint: plot t against the error term.) (d) Which assumption about regression models is being violated here? (e) Is there a difference in the average value of x between the treatment and control

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistical Inference

Authors: George Casella, Roger L. Berger

2nd edition

0534243126, 978-0534243128

More Books

Students also viewed these Mathematics questions

Question

Open T account based on the photo

Answered: 1 week ago

Question

5. Describe additional factors of ethical communication.

Answered: 1 week ago