Question: Q: Help in understanding and solving this example on r studio Rmarkdown, thanks ahead. *Rmarkdown in rstudio language. **Part 1: It's all about Pie**

Q: Help in understanding and solving this example on r studio Rmarkdown, thanks ahead.

*Rmarkdown in rstudio language.

**Part 1: "It's all about Pie"** \ **Directions:** Write the r code for the following questions. (a) Store the data file PI into variable P ```{r} ``` (b) Create a Histogram for the data set. "How Many Numbers Make Up PI?" is the Title. The bar of the graph are blue. ```{r} ``` (c)Change the y-axis frequency to precent. The bars of the graph are purple ```{r} ``` (d)List the frequncey (count) of each enetry in the data file --- Use the function call "table(dataset)" ```{r} ``` **Part 2: Hypothesis Testing** (a)Create a function to compute the standardize z when x_bar = 39.2, mu = 40, s = 3.23, and n = 75 is \ ```{r} Z_standardize <- function(x_bar, mu, s, n) { z = (x_bar - mu)/(s/sqrt(n)) } print(round(Z_standardize(39.2, 40, 3.23, 75), digits = 2)) ``` (b)Create a function to compute the standardize t when x_bar = 39.2, mu = 40, s = 3.23, and n = 13 \ ```{r} # use pt(t-score) to compute the left_tailed t distribution ``` (c) Create a function to compute the critical value when population standard deviation is known, left-tailed and alpha is 0.10. \ left-tailed = 1, right_tailed = 2, and two_tailed = 3 \ ```{r} Z_Critical <- function(alpha, tailed){ if(tailed == 1) return(cat("Critical value is", round(qnorm(alpha), digits = 2))) if(tailed == 2) return(cat("Critical value is", round(qnorm(1 - alpha), digit = 2))) if(tailed == 3) return(cat("Critical values are", round(qnorm(alpha/2), digit =2), "and", round(-qnorm(alpha/2), digit = 2))) } Z_Critical(0.10, 1) ``` (d) Create a function to compute the critical value when population standard deviation is unknown, left-tailed, alpha is 0.10, and n = 15. \ left-tailed = 1, right_tailed = 2, and two_tailed = 3 \ ```{r} # # use tp(alpha, df) to compute t inverse ``` (e) Create a function to compute the p-value if x_bar = 12.9, mu = 13, simga = 0.2, and n = 25, two_tailed \ left-tailed = 1, right_tailed = 2, and two_tailed = 3 **simga is known**\ ```{r} P_Value <- function(x_bar, mu, simga, n, tailed){ z = round((x_bar - mu)/(simga/sqrt(n)), digits = 2) if(tailed == 1) return(cat("p_value is", round(pnorm(z), digits = 4))) if(tailed == 2) return(cat("p_value is", round(1 - pnorm(z), digit = 4))) if(tailed == 3) return(cat("p_values is", round(2*pnorm(z), digit =4))) } P_Value(12.9, 13, 0.2, 25, 3) ``` (f) Create a function to compute the p-value if x_bar = 12.9, mu = 13, s = 0.2, and n = 25, two_tailed \ left-tailed = 1, right_tailed = 2, and two_tailed = 3 **simga is unknown**\ ```{r} # use pt(t-score) to compute the left_tailed t distribution # use tp(alpha, df) to compute t inverse ``` *This is the data:

Digits 3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0 2 8 8 4 1 9 7 1 6 9 3 9 9 3 7 5 1 0 5 8 2 0 9 7 4 9 4 4 5 9 2 3 0 7 8 1 6 4 0 6 2 8 6 2 0 8 9 9 8 6 2 8 0 3 4 8 2 5 3 4 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!