Question

How do I set the problems below in R? Use the rnorm function in R to generate 100 samples of X ~N(-1.0,2.5) (for help use ?rnorm ) and for each draw, simulate Yǐ from the simple linear regression model = 2.5+2.0x,+티, where e, N N(0,3 ).

(iii) What is the marginal sample mean for Y? What is the true marginal mean?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Sample marginal mean of y is 0.5523

True marginal mean

We use additive property of normal distribution

Hence

Mean=2.5+2*(-1)+0 =0.50

For sample mean R code given below

07:25 AM https://rextester.com Language: R X rnorm 100-1.0,2.5) e rnorm(100,0,3) y-2.5+2*x+e mean(y) Run it (Shift+Enter) Sav

Add a comment
Know the answer?
Add Answer to:
How do I set the problems below in R? Use the rnorm function in R to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • How do I set the problems below in R? Use the rnorm function in R to...

    How do I set the problems below in R? Use the rnorm function in R to generate 100 samples of X ~N(-1.0,2.5) (for help use ?rnorm ) and for each draw, simulate Yǐ from the simple linear regression model = 2.5+2.0x,+티, where e, N N(0,3 ). We were unable to transcribe this image

  • How do I set the problems below in R? Use the rnorm function in R to...

    How do I set the problems below in R? Use the rnorm function in R to generate 100 samples of X ~N(-1.0,2.5) (for help use ?rnorm ) and for each draw, simulate Yǐ from the simple linear regression model = 2.5+2.0x,+티, where e, N N(0,3 ). (ii) Split the sample into 2 subsets of size 25 and 75. For each subset, run the regression of Y on X. Add each fitted regression line (use color) to your plot from (i)....

  • STATS Use the R function rnorm() to simulate selecting a random sample of size 25 from...

    STATS Use the R function rnorm() to simulate selecting a random sample of size 25 from a population with mean 80 and s.d. 20. The goal here is to show how contamination affects the mean, s.d., and z-scores. (a) Obtain the sample mean and sample sd of the simulated sample and use them to obtain the z-score for 100. (b) Create the vector contam = c(0,seq(1000,10000,length=21)) To show the effects of contamination, separately add each value of contam to the...

  • Hello, I'm confused about how to set-up a boostrap sample without having an X and Y...

    Hello, I'm confused about how to set-up a boostrap sample without having an X and Y or dataset to use? Do i use dnorm and set that against rnorm? this is in R. Please help. Thank yoou :) Use the rnorm() function to generate random sample size 10 from the normal distribution with mean 0 and standard deviation of 2 Find the bootstrap estimate of standard error of sample mean, SE(¯ c x ∗ 10). Use 2000 bootstrap samples.

  • 2. Suppose Y ~ Exp(a), which has pdf f(y)-1 exp(-y/a). (a) Use the following R code to generate data from the model Yi...

    2. Suppose Y ~ Exp(a), which has pdf f(y)-1 exp(-y/a). (a) Use the following R code to generate data from the model Yi ~ Exp(0.05/Xi), and provide the scatterplot of Y against X set.seed(123) n <- 500 <-rnorm (n, x 3, 1) Y <- rexp(n, X) (b) Fit the model Yi-Ao + Ax, + ε¡ using the lm function in R and provide a plot of the best fit line on the scatterplot of Y vs X, and the residual...

  • a) Use the following R code to empirically check the Central Limit Theorem via simulation .n...

    a) Use the following R code to empirically check the Central Limit Theorem via simulation .n <- 40 # sample size m <- c(1:200) #create a vector of length 200 for (i in 1:200) { #simulate 200 samples x <- rnorm(n) m[i] <- mean(x) } hist(m) b) Repeat part (a) with n=200 and compare the histograms. Describe what you observe and what you expect when n increases. c) Repeat parts (a) and (b) with runif() and rexp() respectively instead of...

  • R programming question. Please use #comments too ! 1. The data set UN11 in the alr4...

    R programming question. Please use #comments too ! 1. The data set UN11 in the alr4 package contains several variables, including ppgdp, per capita gross domestic product in US dollars, and fertility, number of children per woman, from the year 2009-2011. The data are for 199 localities, and we will study the regression of ppgdp on fertility (a) Draw the scatterplot of ppgdp against fertility and describe the relationship between these two variables. Is the trend linear? nD the simple...

  • Finish the following question by showing your Code in R. (μ , σ ). With yield...

    Finish the following question by showing your Code in R. (μ , σ ). With yield reasonably close result as the R regression model b) Simulate at least 4 different simple linear regression scenarios by modifying the mean, the standard 3. Gven a simulated da taset X, and Y-A) + β, x-c, where X ~ N(3.6.2), and ~ the fixed parameters A,-50, and β1: 6, use the code provided in class to answer the following: a) Verify the explicit derivation...

  • How do I set the problems below in R?

    How do I set the problems below in R?

  • For expert using R , I solve it but i need to figure out what I...

    For expert using R , I solve it but i need to figure out what I got is correct or wrong. Thank you # Simple Linear Regression and Polynomial Regression # HW 2 # # Read data from csv file data <- read.csv("C:\data\SweetPotatoFirmness.csv",header=TRUE, sep=",") head(data) str(data) # scatterplot of independent and dependent variables plot(data$pectin,data$firmness,xlab="Pectin, %",ylab="Firmness") par(mfrow = c(2, 2)) # Split the plotting panel into a 2 x 2 grid model <- lm(firmness ~ pectin , data=data) summary(model) anova(model) plot(model)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT