Est.EmpDistFunc.NHT | R Documentation |
Computes the Narain (1951); Horvitz-Thompson (1952) estimator for the empirical cumulative distribution function (ECDF).
Est.EmpDistFunc.NHT(VecY.s, VecPk.s, N, t)
VecY.s |
vector of the variable of interest; its length is equal to n, the sample size. Its length has to be the same as that of |
VecPk.s |
vector of the first-order inclusion probabilities; its length is equal to n, the sample size. Values in |
N |
the population size. It must be an integer or a double-precision scalar with zero-valued fractional part. |
t |
value to be evaluated for the empirical cumulative distribution function. It must be an integer or a double-precision scalar. |
For the population empirical cumulative distribution function (ECDF) of the variable y at the value t:
Fn(t) = \frac{\#(k\in U:y_k ≤q t)}{N} = \frac{1}{N} ∑_{k\in U} I(y_k ≤q t)
the unbiased Narain (1951); Horvitz-Thompson (1952) estimator of Fn(t) (implemented by the current function) is given by:
\hat{F}n_{NHT}(t) = \frac{1}{N} ∑_{k\in s} \frac{I(y_k ≤q t)}{π_k}
where I(y_k ≤q t) denotes the indicator function that takes the value 1 if y_k ≤q t and the value 0 otherwise, and where π_k denotes the inclusion probability of the k-th element in the sample s.
The function returns a value for the empirical cumulative distribution function evaluated at t.
Emilio Lopez Escobar [aut, cre], Juan Francisco Munoz Rosas [ctb].
Horvitz, D. G. and Thompson, D. J. (1952) A generalization of sampling without replacement from a finite universe. Journal of the American Statistical Association, 47, 663–685.
Narain, R. D. (1951) On sampling without replacement with varying probabilities. Journal of the Indian Society of Agricultural Statistics, 3, 169–175.
Est.EmpDistFunc.Hajek
data(oaxaca) #Loads Oaxaca municipalities dataset pik.U <- Pk.PropNorm.U(373, oaxaca$HOMES00) #Reconstructs the inclusion probs. s <- oaxaca$sHOMES00 #Defines the sample to be used N <- dim(oaxaca)[1] #Defines the population size y1 <- oaxaca$POP10 #Defines the variable of interest y1 Est.EmpDistFunc.NHT(y1[s==1], pik.U[s==1], N, 950) #NHT est. of ECDF for y1 at t=950
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.