Skip to contents

The estimated weights from imprr_weights can be used to perform any analyses. For example, to estimate the average rank of party, one can leverage linear regression as follows:

library(rankingQ)
#> Registered S3 method overwritten by 'GGally':
#>   method from   
#>   +.gg   ggplot2
library(estimatr)

data(identity_w)
lm_robust(party ~ 1, data = identity_w, weights = w) |> tidy()
#>          term estimate  std.error statistic p.value conf.low conf.high   df
#> 1 (Intercept) 3.220388 0.02790142  115.4202       0 3.165641  3.275135 1081
#>   outcome
#> 1   party

While this illustrative example provides a valid point estimate, its confidence interval does not account for the estimation uncertainty around the estimated weights. Thus, in practice, imprr_weights must be used along with bootstrapping, such as the one available in rsample (example).