1.The built-in R dataset \"PlantGrowth\" gives data on yields of plants, measure
ID: 3318200 • Letter: 1
Question
1.The built-in R dataset "PlantGrowth" gives data on yields of plants, measured by dry weight, under various treatments. We shall be interested in the weight column of the PlantGrowth dataframe we can get the data in this column by assigning a variable to the column Plant Growthsweight or entering the values 1 by 1·(You would be wise to not do the 1 by 1 entry.) Call the vector of weight values, x. The following is a screen print of the data values: 1] 4.17 5.58 5.18 6.11 4.50 4.61 5.17 4.53 5.33 5.14 4.81 4.17 4.41 3.59 5.87 [161 3.83 6.03 4.89 4.32 4.69 6.31 5.12 5.54 5.50 5.37 5.29 4.92 6.15 5.80 5.26 Assurme hese values are a random sample rom a normal population with distribution X Assume X has mean and standard deviation o. The code or assigning the weight column to a ector xin is x5. We will reject H0 if z = zstar? (Calculate from normal distribution) h) Continuing from part I, what is the value of z? i) Continuing from parts I and m, what is the p value of the test. >zstar where s is the sample standard deviation. what is the value of 30Explanation / Answer
> x=a$weight;x
[1] 4.17 5.58 5.18 6.11 4.50 4.61 5.17 4.53 5.33 5.14 4.81 4.17 4.41 3.59 5.87
[16] 3.83 6.03 4.89 4.32 4.69 6.31 5.12 5.54 5.50 5.37 5.29 4.92 6.15 5.80 5.26
> n=length(x);n
[1] 30
> ###########aaaa) 37% quantile
> y=quantile(x,0.37);y
37%
4.8684
>
> #######bbbb))Sample Variance
> ##S=(1/n-1)*sum((x-xbar)^2)###
> xbar=mean(x);xbar
[1] 5.073
> d=(x-xbar)^2;d
[1] 0.815409 0.257049 0.011449 1.075369 0.328329 0.214369 0.009409 0.294849
[9] 0.066049 0.004489 0.069169 0.815409 0.439569 2.199289 0.635209 1.545049
[17] 0.915849 0.033489 0.567009 0.146689 1.530169 0.002209 0.218089 0.182329
[25] 0.088209 0.047089 0.023409 1.159929 0.528529 0.034969
> b=sum(d);b
[1] 14.25843
> S=(1/(n-1))*b;S
[1] 0.49167
>
> ##########ccc))Sample variance of (3/2)x
> ##Var((3/2)x)=9/4(Var(x))##
> V1=(9/4)*S;V1
[1] 1.106257
>
>
> ####ddddd)mle of variance=(1/n)*sum((x-xbar)^2)###
> smle=(1/n)*b;smle
[1] 0.475281
>
> ####eee) sample mean of (3/2)x
> x2bar=(3/2)*xbar;x2bar
[1] 7.6095
>
>
> #####fffffff)))98% confidence interval for mean####
> ####CI=(xbar(+/-)Zalpha*se(xbar))
> se=sqrt(S/n);se ###standarad erro of sample mean
[1] 0.1280195
> UL=xbar+2.33*se;UL ###2.33 is the value Z at 0.02 level of signiicance
[1] 5.371286
> LL=xbar-2.33*se;LL
[1] 4.774714
>
>
> ####gggg))))
> zstar=2.054 ### at 2% level of significance for right tail test
>
> #####hhhhh))
> z=(xbar-5)/se;z
[1] 0.5702255
>
>
> #######iii))p value of the test
> p=0.3049;p
[1] 0.3049
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.