





Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!






1) Console → It is possible to type in the commands we intend to execute and in which the output produced by the commands is printed. 2) Script → It allows you to write several lines of code (while the console is useful for just few lines).
Assign a variable → <- or =
x <- 7 x [1] 7 Note! The == logical operator, instead, checks if the left side is equal to the right side and returns TRUE or FALSE.
Create a vector → c(elements)
vector_name <- c(4,6, 8 ,12) Selecting elements from vectors → [position_of_the_element] vector_name[3] [1] 8 Slicing a vector → : x = 0:6 (from 0 to 6) Functions of vectors
To download a package:
→ PDF : f(x) = dnorm(x, mean, sd) → CDF : F(x) = P(X<x) = pnorm(x, mean, sd) F(x) = P(X>x) = 1- pnorm(x, μ, σ) = pnorm(x, μ, σ, lower.tail=FALSE) Quantiles of order x → Qx = qnorm(x, mean, sd)
Density → PDF: f(x) = dt(x, df) Distribution function → CDF: F(x) = P(X<x) = pt(x, df) F(x) = P(X>x) = 1- pt(x, df) = pt(x, df, lower.tail=FALSE) Quantiles of order x → Qx = qt(x, df)
Density → PDF: f(x) = dchisq(x, df) Distribution function → CDF: F(x) = P(X<x) = pchisq(x, df) F(x) = P(X>x) = 1- pchisq(x, df) = pchisq(x, df, lower.tail=FALSE) Quantiles of order x → Qx = qchisq(x, df)
Define the model
SINGLE PROPORTION (Hypothesis test case 3)