Description Usage Arguments Value Examples

Estimates the means for the specified variables measured in a sample given some pre-calculated weights.

1 | ```
mean_estimation(sample, weights, estimated_vars, N = NULL)
``` |

`sample` |
A data frame containing the sample with the variables for which the means are to be calculated. |

`weights` |
A vector of pre-calculated weights. |

`estimated_vars` |
String vector specifying the variables in the sample to be estimated. |

`N` |
An integer specifying the population size (optional). |

A vector with the corresponding estimations.

1 2 3 4 | ```
covariates = c("education_primaria", "education_secundaria")
data_propensities = propensities(sampleNP, sampleP, covariates)
psa_weights = sc_weights(data_propensities$convenience)
mean_estimation(sampleNP, psa_weights, c("vote_pens"))
``` |

```
Loading required package: lattice
Loading required package: ggplot2
vote_pens
0.3529725
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.