sample_size | R Documentation |
The unweighed sample size is the number of non-missing elements in x
. The
weighted sample size is the sum of the weights for the complete cases in x
and w
. The effective sample size is (sum(w)^2) / sum(w^2)
.
sample_size(x, w, type = "u")
x |
A vector. |
w |
A vector of weights. |
type |
One of |
Either a single numeric value, or a named vector if type = "all"
.
x <- 1:3
w <- c(0.75, 1.00, 1.25)
sample_size(x, w, type = "u")
sample_size(x, w, type = "w")
sample_size(x, w, type = "e")
sample_size(x, w, type = "all")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.