mrp_estimation_stan: Postratified estimation for the number of votes for several...

Description Usage Arguments

View source: R/mrp_estimation_stan.R

Description

The function fits a model using the rstan package and predicts proportional of votes for all candidates candidate in unobserved polling stations. Optionally the model can be fit with a stratified random sample

Usage

1
2
3
4
mrp_estimation_stan(data, stratum, n_iter = 500, n_warmup = 250,
  n_chains = 1, seed = NA, model_string = NULL,
  set_strata_na = integer(0), partidos = c("RAC", "JAMK", "AMLO", "JHRC",
  "OTROS"), frame_name = "marco_nal_2018")

Arguments

data

A data.frame with variables: ln_total, region, distrito_loc_17, tamano_md, tamano_gd, casilla_ex and the column with number of votes for the party.

stratum

If sampling the data, unquoted variable indicating the column from the data.frame to be used as strata. The strata will also be used in the hierarchical structure of the model.

n_iter

Number of iterations, burnin size and chains. to be used in jags.

n_warmup

burnin size

n_chains

Number of iterations, burnin size and chains. to be used in jags.

seed

Integer value used to set the state of the random number generator.

model_string

String indicating the model to be used, if NULL defaults to "model_bern_t", also available "model_t".

set_strata_na

Option to exclude strata when fitting the model, used for model evaluation and calibration.


tereom/quickcountmx documentation built on Dec. 2, 2019, 9:58 p.m.