Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose Z is a standard normal random variable. Suppose X is a normal random var

ID: 3313923 • Letter: S

Question

Suppose Z is a standard normal random variable. Suppose X is a normal random variable with mean 4 and standard deviation 5. Answer the following using R code.

a) If X and Z are independent then what is the variance of 2X - 4Z using R code?

Suppose W, X, and Y are independent normal random variables with common mean $mu$ and known standard deviations 3,7,1 respectively. We take one observation from W, one from X and one from Y. Let S=3W-2X+5Y be a weighted sum of the three random variables. Call the realized sum s. Answer the following using R code.

b) If the realized s = 45 then what is the p-value of the test using R code?  

Explanation / Answer

I assume that you want to know the results by simulation.But,you have not clearly mentioned the test you are looking for. So, i am trying to figure out the best possible answer.

##a ##1st part
iter=100
v=rep(0,100)
for(i in 1:iter)
{
X=rnorm(10000,mean=4,sd=5)
Z=rnorm(10000)
D=2*X-4*Z
v[i]=var(D)
}
mean(v)
##we repeat the process 100 times to get 100 estimators of variance such that,
##the resulting estimator which is average of all 100 estimators will have much
##lower variance

##a ##2nd part
W=rnorm(1,mean=4,sd=3)
X=rnorm(1,mean=4,sd=7)
Y=rnorm(1,mean=4,sd=1)
s=3*W-2*X+5*Y

#b
##s should have mean zero and variance=3^2+7^2+1^1=9+49+1=59,so sd=sqrt(59)=7.681146
##we may want to test whether S has expectation zero or not,such that S/7.681146 follows
##N(0,1) distribution under zero mean.The test is both sided.H0:mu=0 vs Ha: mu!=0
###realised value os s=45,so s/7.681146=5.858501

s_real=45
sd=7.681146
z=s_real/sd
z
##pvalue
2*pnorm(z,lower.tail = FALSE)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote