create_weight: Calculate the weights from the denominator

View source: R/clean_measure_score_table.R

create_weightR Documentation

Calculate the weights from the denominator

Description

Calculate the weights from the denominator

Usage

create_weight(x = r_x)

Arguments

x

A data frame containing the measure denominator of the hospital compare star rating.

Details

The formula:

w_{khd} = \frac{n_{khd}}{\sum_{i=1}^{N_{kd}}(n_{khd})} * N_{kd}

Where:

  • w_{khd}: Weight for measure k, hospital h, measure group d

  • n_{khd}: Denominator for hospital h, measure k in measrue group d

  • N_{kd}: The total number of hospitals for measure k in measure group d

R^2 = 1 - \frac{estimated variance}{observed variance}

Value

A data frame containing the weighting factor which will used to perform lvm.

Examples

:



huangrh/rstarating documentation built on Oct. 28, 2024, 3:33 p.m.