Question 3: a. Write R code to simulate n observations (X, Y) from the model: X~ N(0,5), Y|X~ N(2X +3,3). (Hint: use rnorm to generate random variables from the normal distri- bution. b. Simulate 50 datasets for n = 30, and, for each dataset, fit a regression model (Y|X = Bo+BX+e). Make a histogram of the 50 estimates of 3₁. What are the sample mean and sample variance of these 50 estimates?

Calculus For The Life Sciences
2nd Edition
ISBN:9780321964038
Author:GREENWELL, Raymond N., RITCHEY, Nathan P., Lial, Margaret L.
Publisher:GREENWELL, Raymond N., RITCHEY, Nathan P., Lial, Margaret L.
Chapter1: Functions
Section1.EA: Extended Application Using Extrapolation To Predict Life Expectancy
Problem 5EA
icon
Related questions
Question
Question 3:
a. Write R code to simulate n observations (X,Y) from the model: X~ N(0,5), Y|X-
N (2X +3,3). (Hint: use rnorm to generate random variables from the normal distri-
bution.
b. Simulate 50 datasets for n = 30, and, for each dataset, fit a regression model (Y|X =
Bo+ BiX+c).
Make a histogram of the 50 estimates of 3₁. What are the
sample mean and sample variance of these 50 estimates?
Transcribed Image Text:Question 3: a. Write R code to simulate n observations (X,Y) from the model: X~ N(0,5), Y|X- N (2X +3,3). (Hint: use rnorm to generate random variables from the normal distri- bution. b. Simulate 50 datasets for n = 30, and, for each dataset, fit a regression model (Y|X = Bo+ BiX+c). Make a histogram of the 50 estimates of 3₁. What are the sample mean and sample variance of these 50 estimates?
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Calculus For The Life Sciences
Calculus For The Life Sciences
Calculus
ISBN:
9780321964038
Author:
GREENWELL, Raymond N., RITCHEY, Nathan P., Lial, Margaret L.
Publisher:
Pearson Addison Wesley,
Glencoe Algebra 1, Student Edition, 9780079039897…
Glencoe Algebra 1, Student Edition, 9780079039897…
Algebra
ISBN:
9780079039897
Author:
Carter
Publisher:
McGraw Hill
College Algebra
College Algebra
Algebra
ISBN:
9781305115545
Author:
James Stewart, Lothar Redlin, Saleem Watson
Publisher:
Cengage Learning
Linear Algebra: A Modern Introduction
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Big Ideas Math A Bridge To Success Algebra 1: Stu…
Big Ideas Math A Bridge To Success Algebra 1: Stu…
Algebra
ISBN:
9781680331141
Author:
HOUGHTON MIFFLIN HARCOURT
Publisher:
Houghton Mifflin Harcourt