knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(jeksterslabRdata)
See fit()
for more details.
univ()
xstar <- univ(n = 100, rFUN = rnorm, mean = 100, sd = sqrt(225), R = 100)
mean()
Function Using fit()
Run the function.
thetahatstar <- fit(Xstar = xstar, fitFUN = mean, rbind = TRUE)
Explore the output.
str(thetahatstar) hist(thetahatstar, main = expression("Sampling distribution of" ~ hat(mu)), xlab = expression(hat(mu)) )
var()
Function Using fit()
Run the function.
thetahatstar <- fit(Xstar = xstar, fitFUN = var, rbind = TRUE)
Explore the output.
str(thetahatstar) hist(thetahatstar, main = expression("Sampling distribution of" ~ hat(sigma)^2), xlab = expression(hat(sigma)^2) )
xstar <- univ(n = 100, rFUN = rbinom, size = 1, prob = 0.50, R = 100)
mean()
Function Using fit()
Run the function.
thetahatstar <- fit(Xstar = xstar, fitFUN = mean, rbind = TRUE)
Explore the output.
str(thetahatstar) hist(thetahatstar, main = expression("Sampling distribution of" ~ hat(mu)), xlab = expression(hat(mu)) )
var()
Function Using fit()
Run the function.
thetahatstar <- fit(Xstar = xstar, fitFUN = var, rbind = TRUE)
Explore the output.
str(thetahatstar) hist(thetahatstar, main = expression("Sampling distribution of" ~ hat(sigma)^2), xlab = expression(hat(sigma)^2) )
xstar <- univ(n = 100, rFUN = rbinom, size = 40, prob = 0.50, R = 100)
mean()
Function Using fit()
Run the function.
thetahatstar <- fit(Xstar = xstar, fitFUN = mean, rbind = TRUE)
Explore the output.
str(thetahatstar) hist(thetahatstar, main = expression("Sampling distribution of" ~ hat(mu)), xlab = expression(hat(mu)) )
var()
Function Using fit()
Run the function.
thetahatstar <- fit(Xstar = xstar, fitFUN = var, rbind = TRUE)
Explore the output.
str(thetahatstar) hist(thetahatstar, main = expression("Sampling distribution of" ~ hat(sigma)^2), xlab = expression(hat(sigma)^2) )
mvn()
Sigma <- matrix( data = c(1, 0.50, 0.50, 1), ncol = 2 ) Xstar <- mvn(n = 100, Sigma = Sigma, R = 100)
cov()
Function Using fit()
Run the function.
foo <- function(X) { as.vector(cov(X)) } thetahatstar <- fit(Xstar = Xstar, fitFUN = foo, rbind = TRUE)
Explore the output.
thetahatstar <- thetahatstar[, 2] str(thetahatstar) hist(thetahatstar, main = expression("Sampling distribution of" ~ hat(rho)), xlab = expression(hat(rho)) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.