Consider the SLR y = 50 + 10x + e where e is NID(0.16). n = 20 pairs of observations. Generate 500 samples of 20 obersvations drawing 1 observations drawing one observation from each level of x = .5,1,1.5 ... 10 for each sample A) For each sample computer the least squares regression estimates of the slop and intercept. Construct histograms of the sample values of B_0_hat and B_1_hat. B) For each sample compute an estimate of E(y|x=5) Construct a histogram from these estimates. C) For each sample compute a 95% CI on the slope. How manyt of these contain the true value B_1 = 10 D) For each estimate of E(y|x=5) in part b compute the 95% CI. How many of these intervals contain the trye value of E(y|x=5)=100? I have 0 idea how to do these as R was not a prereq for my regression course but is needed for these problems. As much help as you could offer would be amazing. -- View this message in context: http://n4.nabble.com/SLR-500-Random-Samples-tp1555769p1555769.html Sent from the R help mailing list archive at Nabble.com.
it seems that this is a homework! Please read carefully the Posting Guide: http://www.r-project.org/posting-guide.html -- the R-help mailing list is not intended for "Basic Statistics and classroom homework"! Best, Dimitris Schwonka wrote:> Consider the SLR y = 50 + 10x + e where e is NID(0.16). n = 20 pairs of > observations. Generate 500 samples of 20 obersvations drawing 1 observations > drawing one observation from each level of x = .5,1,1.5 ... 10 for each > sample > > A) For each sample computer the least squares regression estimates of the > slop and intercept. Construct histograms of the sample values of B_0_hat and > B_1_hat. > > B) For each sample compute an estimate of E(y|x=5) Construct a histogram > from these estimates. > > C) For each sample compute a 95% CI on the slope. How manyt of these contain > the true value B_1 = 10 > > D) For each estimate of E(y|x=5) in part b compute the 95% CI. How many of > these intervals contain the trye value of E(y|x=5)=100? > > I have 0 idea how to do these as R was not a prereq for my regression course > but is needed for these problems. As much help as you could offer would be > amazing.-- Dimitris Rizopoulos Assistant Professor Department of Biostatistics Erasmus University Medical Center Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands Tel: +31/(0)10/7043478 Fax: +31/(0)10/7043014
Hi seems to me like a homework for bootstraping see ?boot, ?lm, ?confint If not, some code how you tried to solve it yourself and how it did not worked as expected would be greatly appreciated. Regards Petr r-help-bounces at r-project.org napsal dne 15.02.2010 05:41:14:> > Consider the SLR y = 50 + 10x + e where e is NID(0.16). n = 20 pairs of > observations. Generate 500 samples of 20 obersvations drawing 1observations> drawing one observation from each level of x = .5,1,1.5 ... 10 for each > sample > > A) For each sample computer the least squares regression estimates ofthe> slop and intercept. Construct histograms of the sample values of B_0_hatand> B_1_hat. > > B) For each sample compute an estimate of E(y|x=5) Construct a histogram > from these estimates. > > C) For each sample compute a 95% CI on the slope. How manyt of thesecontain> the true value B_1 = 10 > > D) For each estimate of E(y|x=5) in part b compute the 95% CI. How manyof> these intervals contain the trye value of E(y|x=5)=100? > > I have 0 idea how to do these as R was not a prereq for my regressioncourse> but is needed for these problems. As much help as you could offer wouldbe> amazing. > -- > View this message in context:http://n4.nabble.com/SLR-500-Random-Samples-> tp1555769p1555769.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.