MDIAwtGroups: Function to find weights to apply to a number of groups in a...

View source: R/MIDIAweightingFUNC.R

MDIAwtGroupsR Documentation

Function to find weights to apply to a number of groups in a data set to ensure equivalence on some variables.

Description

Method is from Haberman, 1984.

Usage

MDIAwtGroups(formula, data, groups, targetgroup = NA)

Arguments

formula

A formula indicating the variables on which matching should be achieved after weighting. For example, ~x+I(x^2)+y+I(y^2)+I(y^3) would achieve matched values on the mean value of x, the squared mean value of x (essentially equivalent to the variance), and (essentially) the mean, standard deviation and skewness of y.

data,

A data frame.

groups

A vector indicating the group to which each row of the data belongs.

targetgroup

Single value indicating which group defines the population to which all other groups should be weighted. By default all groups are weighted to match the overall mean.

Value

A vector of weights.

References

Haberman, S. J. (1984). Adjustment by minimum discriminant information. The Annals of Statistics, 12(3), 971-988.


CambridgeAssessmentResearch/KernEqWPS documentation built on Feb. 23, 2024, 9:34 p.m.