Question

Please answer this question in both mathematically and with R. I need R code also.. Its urgent...3.14 For the variables in Table 3.4, define z 3y1 y2 2y3 (3,-1,2)y. Find z and sz in two ways: (a) Evaluate z for each row of Table 3.4 and find Z and s directly from 21,22,., 210 using (3.1) and (3.5). (b) Use zay and s2- aSa, as in (3.54) and (3.55).The sample mean of a random sample of n observations Y1, уг, . . . , yn ls given by the ordinary arithmetic average yi 7nThe variance of the population is defined as var(y-ơ2-E(y- )2. This is the average squared deviation from the mean and is thus an indication of the extent to which the values of y are spread or scattered. It can be shown that σ2-E(y2)- The sample variance is defined as (3.4) 7-1 which can be shown to be equal to (3.5) n-lThe sample mean of z can be found either by averaging the n values z1 - ayi,z2- дуг, . . . ,Zn _ ayn or as a linear combination of y, the sample mean vector of y1, y2, . .. , Vn: zi a у. (3.54) The result in (3.54) is analogous to the univariate result (3.3), z- ay, where zi - aVi,i 1,2 Similarly, the sample variance of Zi alyi, 2 1, 2, . n, can be found as the sample variance of 21, 22,... , 2n or directly from a and S, where S is the sample covariance matrix ofYu Уг, . . . , yni 2 Zi- 2 (3.55) TlTable 3.4 Calcium in Soil and Turnip Greens Location Number yıy2 уз 35 3.5 2.80 35 4.9 2.70 40 30.0 4.38 102.8 3.21 6 2.7 2.73 20 2.8 2.81 35 4.6 2.88 35 10.9 2.90 35 8.0 3.28 30 16 3.20 4 10

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

(a) R code:

y1=c(35,35,40,10,6,20,35,35,35,30)
y2=c(3.5,4.9,30,2.8,2.7,2.8,4.6,10.9,8,1.6)
y3=c(2.80,2.70,4.38,3.21,2.73,2.81,2.88,2.90,3.28,3.20)
z=3*y1-y2+2*y3
mean(z)
sum(z^2)
s=(sum(z^2)-10*mean(z)^2)/9
s

Output:

> mean(z)
[1] 83.298
> sum(z^2)
[1] 78823.5
> s=(sum(z^2)-10*mean(z)^2)/9
> s
[1] 1048.659
10 1 0 ~i 83.298 10 Σ2 = 78823.5 10

(b)

R code:

y1=c(35,35,40,10,6,20,35,35,35,30)
y2=c(3.5,4.9,30,2.8,2.7,2.8,4.6,10.9,8,1.6)
y3=c(2.80,2.70,4.38,3.21,2.73,2.81,2.88,2.90,3.28,3.20)
s11=(sum(y1^2)-10*mean(y1)^2)/9
s22=(sum(y2^2)-10*mean(y2)^2)/9
s33=(sum(y3^2)-10*mean(y3)^2)/9
s12=(sum(y1*y2)-10*mean(y1)*mean(y2))/9
s13=(sum(y1*y3)-10*mean(y1)*mean(y3))/9
s23=(sum(y2*y3)-10*mean(y2)*mean(y3))/9
M=matrix(c(s11,s12,s13,s12,s22,s23,s13,s23,s33),nrow=3,ncol=3)
Mean_z=c(3,-1,2)%*%c(mean(y1),mean(y2),mean(y3))
var_z=c(3,-1,2)%*%M%*%c(3,-1,2)
Mean_z
var_z

Output:

> Mean_z
[,1]
[1,] 83.298
> var_z
[,1]
[1,] 1048.659

Add a comment
Know the answer?
Add Answer to:
Please answer this question in both mathematically and with R. I need R code also.. Its...
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
  • Really short question! Please help me to solve part(b), also need the R code, thank you!...

    Really short question! Please help me to solve part(b), also need the R code, thank you! Problem 4 [26 points] (Section 2.4): Consider a one-sample z-test (known variance) with hypotheses: Ho: μ lo vs H, μ μο. a/2 where φ(.)Is the CDF of N(0,1), d-layo, and δ is the difference between the true mean and the mean under Ho (a) [10 points] Based on the fact that φ(x) [pdf of N(0,1)] is a decreasing function in x when x> 0,...

  • Hello can someone help me answer this please Suppose that X (X1,X2, . . . ,...

    Hello can someone help me answer this please Suppose that X (X1,X2, . . . , X.) ald Y-(Yİ,%, , Y,n) are random samples from continuous distributions F and G, respectively. Wilcoxon's two-sample test statistioc W- W(X,Y) is defined to be X/Ri where Ri is the rank of Y in the combined sample. 1. Let T Z, where Z, Z2,, Zm are numbers sampled at random without replacement from the set {1,2,...,N) Show that E(Z) = (N + 1)/2 and...

  • Really short question! Please help me to solve ONLY part(b) with R code. Thank you! Problem...

    Really short question! Please help me to solve ONLY part(b) with R code. Thank you! Problem 4 [26 points] (Section 2.4): Consider a one-sample z-test (known variance) with hypotheses: Ho: μ lo vs H, μ *Ho. The probability of Type II error can be written in the form |ß D(%2_Jnd)-0(-%2_Jnd) where Φ㈠ is the CDF of N(0,1), d Isyo, and δ is the difference between the true mean and the mean under Ho (a) [10 points] Based on the fact...

  • This problem is using R. Can an expert answer this question? I also need to find...

    This problem is using R. Can an expert answer this question? I also need to find the anova and its summary from R. A scientist wants to see if the type of four vitamin supplements (A, B, C, D) affects the weight gain (y in grams) of laboratory animals. The experiment was conducted in a completely randomized design with five separately caged animals for each treatment. Since the caloric intake (in calories/10) will differ among animals and influence y, she...

  • Need help with review. Please answer both questions. I really need help. This Question: 1 pt...

    Need help with review. Please answer both questions. I really need help. This Question: 1 pt 7 of 8 (6 complete) A sample mean, sample size, and sample standard deviation are provided below. Use the one-mean t-test to perform the required hypothesis test at the 1% significance level. - :28. s:8, n:32, Ho : μ=30. Ha-μ:30 Data Table Ell Click here to view a partial table of values of ta The test statistic ist- (Round to two decimal places as...

  • Question 3. 25 marks This question is about the downlink of a two user system, with...

    Question 3. 25 marks This question is about the downlink of a two user system, with one base station (BS) sending signals to two users, denoted user 1 and user 2. The BS is equipped with an array of n antenna elements, and each user has a single antenna. The system is a flat fading scenario, with a single complex channel coefficient from each BS antenna to each user in the base-band channel representation. We denote the channel coefficients from...

  • please answer by steps so i can understand, thank you in advance QUESTION 7 The average...

    please answer by steps so i can understand, thank you in advance QUESTION 7 The average moviegoer sees 8.5 movies a year. A moviegoer is defined as a person who sees at least one movie in a theater in a 12-month period. A random sample of 40 moviegoers from a large university revealed that the average number of movies seen per person was 9.6. The population standard deviation is 3.2 movies. At the 0.05 level of significance, can it be...

  • please help me make this into a contradiction or a direct proof please. i put the question, my answer, and the textbook i used. thank you also please write neatly proof 2.5 Prove har a Sim...

    please help me make this into a contradiction or a direct proof please. i put the question, my answer, and the textbook i used. thank you also please write neatly proof 2.5 Prove har a Simple sraph and 13 cdges cannot be bipartite CHint ercattne gr apn in to ertex Sets and Court tne忤of edges Claim Splitting the graph into two vertex, Sets ves you a 8 Ver ices So if we Change tne书 apn and an A bipartite graph...

  • i am stuck can someone help me answer these please 0.2.9 Question Help 0 Find the...

    i am stuck can someone help me answer these please 0.2.9 Question Help 0 Find the indicated 10 score. The graph to the right depicts 10 scores of adults, and those scores are normally distributed with a mean of 100 and a standard deviation of 15. Click to view page 1 of the table. Click to view page 2 of the table. 0.99 0 The indicated IQ score, x, is (Round to one decimal place as needed.) Question Help y...

  • what code in R should I use if I want to achieve 10 different outputs with the same n. n= a number that doesnt satisfies the CLT my distributions are pois(0.8) and t(2) the one I used is below but...

    what code in R should I use if I want to achieve 10 different outputs with the same n. n= a number that doesnt satisfies the CLT my distributions are pois(0.8) and t(2) the one I used is below but I don’t think it’s right if anyone can help me please resolve this code so I can do the same thing with 10 different values of n. and of that n I need to know the mean, the min, max,...

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