powered by
Function to make estimations of diferent parameters based on a Simple Random Sample.
srs.estimator( N, data, estimator = c("total", "mean", "proportion", "class total"), replace = FALSE, alpha )
A list containing different interest values:
estimator
variance
sampling.error
estimation.error
confint
Number of instances of the data set.
Sample of the data. It must only contain a single column of the data to estimate.
Estimator to compute. Can be one of "total", "mean", "proportion", "class total". Default is "total".
Whether the sample has been taken with replacement or not.
Optional value to calculate estimation error and build 1-alpha confidence interval.
data<-rnorm(200, 100, 20) sample<-data[srs.sample(200, 50)] tau<-sum(data);tau srs.estimator(200, sample, "total", alpha=0.05) mu<-mean(data);mu srs.estimator(200, sample, "mean", alpha=0.05)
Run the code above in your browser using DataLab