View source: R/srs.domainestimator.R
srs.domainestimator | R Documentation |
Function to make estimations of diferent parameters on a given domain based on a Simple Random Sample.
srs.domainestimator(
Nh,
data,
estimator = c("total", "mean", "proportion", "class total"),
domain,
replace = FALSE,
alpha
)
Nh |
Number of instances of the data set domain. |
data |
Sample of the data. It must constain a column with the data to estimate and a second column with the domain of each instance. |
estimator |
One of "total", "mean". Default is "total". |
domain |
Domain of the sample from which parameter estimation will be done. |
replace |
Whether the sample to be taken can have repeated instances or not. |
alpha |
Optional value to calculate estimation error and build 1-alpha confidence interval. |
Data columns must be arranged with interest values on the first column
and domain values on the last column.
Domain parameter can be either numeric or character
and must be equal to one of the values of the domain column of data.
A list containing different interest values:
estimator
variance
sampling.error
estimation.error
confint
Pérez, C. (1999) Técnicas de muestreo estadístico. Teoría, práctica y aplicaciones informáticas. 193-195
data<-cbind(rnorm(500, 50, 20), rep(c(1:2),250))
sample<-data[srs.sample(500, 100),]
sum(data[which(data[,-1]==1),1])
srs.domainestimator(Nh = 250, data = sample, estimator="total", domain=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.