Question

In: Statistics and Probability

PLEASE WRITE IN R CODE. Has to output on R software. (1) The stem length of...

PLEASE WRITE IN R CODE. Has to output on R software.

(1) The stem length of soybeans from an experiment are:

20.2, 22.9, 23.3, 20.0, 19.4, 22.0, 22.1, 22.0, 21.9, 21.5, 20.9

a. Create a histogram to visualize the data

b. Test "t.test" whether the population mean is different from 22

c. Obtain a 2 sided 98% confidence interval on the true mean using "t.test".

d. The researcher, by using "t.test" on a sample size of 11 was assuming that the data was normally distributed. Is that a valid claim? Create a QQ plot and interpret.

Solutions

Expert Solution

R-codes are given in bold text

1)

R-code for Histogram

stem_length=c(20.2, 22.9, 23.3, 20.0, 19.4, 22.0, 22.1, 22.0, 21.9, 21.5, 20.9)

hist(stem_length,main="Histogram For Stem length of Soyabean",xlab="Stem length of Soyabean",col="darkmagenta")

b) R-code

t.test(sepallength,mu=22,conf.level=0.98,alternative='two.sided')

One Sample t-test

data: stem_length
t = -1.4316, df = 10, p-value = 0.1828
alternative hypothesis: true mean is not equal to 22
98 percent confidence interval:
20.45480 22.49065
sample estimates:
mean of x
21.47273

Here Ho =  population mean is different from 22

vs H1 = population mean is not different from 22

Here p-value= 0.1828 which is greater than 0.05 level of significance so we accept null hypothesis and conclude that population mean is different from 22

3) 2 sided 98% confidence interval on the true mean using "t.test"

98 percent confidence interval:
20.45480 22.49065

d) R-code

qqnorm(stem_length)
qqline(stem_length, col = "steelblue", lwd = 2)

Conclusion: By observing above Q-Q plot all points are lies near to line so the data follows normality assumption.


Related Solutions

C++ program. Please explain how the code resulted in the output. The code and output is...
C++ program. Please explain how the code resulted in the output. The code and output is listed below. Code: #include <iostream> #include <string> using namespace std; int f(int& a, int b) {    int tmp = a;    a = b;    if (tmp == 0) { cout << tmp << ' ' << a << ' ' << b << endl; }    b = tmp;    return b;    return a; } int main() {    int a...
Please attach the output screenshots, narrative descriptions, or paste the Python codes. Please write code to...
Please attach the output screenshots, narrative descriptions, or paste the Python codes. Please write code to print the type of the following variables. Please write down the codes and the output as well. x = 3.5 y = '3.5' z = {1:'John', 2:'Wick', 3:'Barry', 4:'Allen'}
Write the code to return the output in Rstudio. What is the code? Code: x <-...
Write the code to return the output in Rstudio. What is the code? Code: x <- c(28, 69, 5, 88, 19, 20) Output must be: [1] 4 2 1 6 5 3
What is the output of the following C++ code? int* length; int* width; length = new...
What is the output of the following C++ code? int* length; int* width; length = new int; *length = 5; width = length; length = new int; *length = 2 * (*width); cout << *length << " " << *width << " " << (*length) * (*width) << endl;
modify code to write the output as an HTML table to a file in the output...
modify code to write the output as an HTML table to a file in the output directory. The file that is saying to work at : SOURCE CODE IN PERL: print "Enter principal amount: "; $P=; while($P<=0) { print "Principal must be positive. Try again: "; $P=; } print "Enter number of times interest is applied in a year: "; $n=; while($n!=12 && $n!=4 && $n!=2 && $n!=1) { print "It must be 12, 4, 2 or 1. Try again:...
(Be sure to paste the R Console Output and code!!!) Using the following data and R,...
(Be sure to paste the R Console Output and code!!!) Using the following data and R, write a brief paragraph about whether the in-home treatment is equally effective as the out-of-home treatment for two separate groups. Here are the data. The outcome variable is level of anxiety after treatment on a scale from 1 to 10. In-Home Treatment Out-of-Home Treatment 3 7 4 6 1 7 1 8 1 7 3 6 3 5 6 6 5 4 1 2...
Java Searching and Sorting, please I need the Code and the Output. Write a method, remove,...
Java Searching and Sorting, please I need the Code and the Output. Write a method, remove, that takes three parameters: an array of integers, the length of the array, and an integer, say, removeItem. The method should find and delete the first occurrence of removeItem in the array. If the value does not exist or the array is empty, output an appropriate message. (After deleting an element, the number of elements in the array is reduced by 1.) Assume that...
What is the output of the code below? After each line that has a cout, write...
What is the output of the code below? After each line that has a cout, write what the output of the code is. See example in code below. int i = 2, j = 1, k = i + j; cout << k << endl; ➔ 3 double d = 2.99, e = 1, f = d + e; cout << f << endl; double q = 1.50; cout << q/3 << endl; cout << 6.0/4 << endl; char c...
I would need both SAS & R code, the output and .txt file/s, please. Because many...
I would need both SAS & R code, the output and .txt file/s, please. Because many HMOs either do not cover mental health costs or provide only minimal coverage, min- isters and priests often need to provide counseling to persons suffering from mental illness. An in- terdenominational organization wanted to determine whether the clerics from different religions have different levels of awareness with respect to the causes of mental illness. Fifteen clerics from different Christian denominations were sampled. Each was...
APPLIED STATISTICS 2 PLEASE USE R, SHOW R CODE AND OUTPUT, with conclusion Let x<-c(1,2,3,4,5,6,7,8), y<-c(4,6,3,7,8,3,9,...
APPLIED STATISTICS 2 PLEASE USE R, SHOW R CODE AND OUTPUT, with conclusion Let x<-c(1,2,3,4,5,6,7,8), y<-c(4,6,3,7,8,3,9, 6.5). By vector operation (other method will get 0 point), find a). the equation of regression line, that is, find a, b. b). Find SSR, SSE c). Find F-value d). Find p-value e). Make your decision, that is, answer the question, can we say y and x have linear relationship at alpha=0.05?.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT