Skip to contents

Generate a sampling distribution from a statistics applied to samples generated from a normal distribution.

Usage

sampdist(n, mean = 0, sd = 1, B = 1000, FUN)

Arguments

n

sample size

mean

the mean of the normal distribution

sd

the standard deviation of the normal distribution

B

the number of simulations

FUN

the function to be applied to each sample

Value

a vector of length B with the sampling distribution

Examples

sampdist(30, 0, 1, B = 10, FUN = mean)
#>  [1] -0.095029874  0.143628744  0.334951131 -0.014717015  0.080732348
#>  [6]  0.115861705  0.031795931 -0.005056035 -0.063708322  0.298270174