wscale: Scale of Sampling Weights

View source: R/wscale.R

wscaleR Documentation

Scale of Sampling Weights

Description

Uses the cluster and ecluster (cluster size and effective cluster size) options specified in Mplus. See note from the Mplus website. If there is no variation in weights within a cluster, the weights will scale to 1.

Usage

wscale(cluster, data, wt, type = "cluster")

Arguments

cluster

The cluster variable.

data

The original dataset.

wt

The weight variable to scale.

type

Either cluster or ecluster. See pdf from Mplus website.

Examples

data(pisa2012, package = 'MLMusingR')
pisa2012$clustwt <- wscale('schoolid', pisa2012, 'w_fschwt')

MLMusingR documentation built on April 3, 2025, 5:43 p.m.