Learn R Programming

RM.weights (version 2.0)

tab.weight: Rasch descriptives and weighted tables.

Description

This function computes the main descriptive tables (number of affirmative responses to each item, weighted and unweighted distribution across raw scores, etc.), weighted and unweighted, for Rasch scale items and respondents. It also computes (univariate or bivariate) tables for user-specified variables.

Usage

tab.weight(variab, wt, XX = NULL)

Arguments

variab

It could be a single variable, or a list of two variables, of factor type.

wt

Vector of sampling weights. length(variab) = length(wt).

XX

0/1 data matrix or data frame of responses to the questionnaire. Affirmative responses must be coded as 1s. If left unspecified, basic descriptive statistics for Rasch analysis (number of Yes per item, weighted and unweighted distribution across raw scores, etc.) are not computed.

Value

RS.abs.w

Absolute weighted distribution across raw scores. Only computed when XX is not null.

RS.rel.w

Relative weighted distribution across raw scores. Only computed when XX is not null.

RS.abs

Absolute unweighted distribution across raw scores. Only computed when XX is not null.

RS.rel

Relative unweighted distribution across raw scores. Only computed when XX is not null.

Perc.Yes

Proportion of Yes responses to each item. Only computed when XX is not null.

Perc.Yes.w

Weighted proportion of Yes responses to each item. Only computed when XX is not null. Only computed when XX is not null.

rv

Vector of raw scores.

tab.ext.w

Weighted table for the variable variab. If variab is a list, a bivariate frequency table is computed.

Examples

Run this code
# NOT RUN {
data(data.FAO_country1)
XX.country1 = data.FAO_country1[,1:8]
wt.country1 = data.FAO_country1$wt
gender = data.FAO_country1$gender
urbanrural = data.FAO_country1$urbanrural
# Univariate weighted table by gender
tab.weight(gender, wt.country1)$tab.ext.w

# Bivariate weighted table by gender and urban/rural
tab.weight(list(gender,urbanrural), wt.country1)$tab.ext.w

# Fit Rasch descriptives
fit.descr = tab.weight(wt = wt.country1, XX = XX.country1)
# Weighted distribution across raw-scores (absolute and relative)
cbind("Abs.RS distrib." = fit.descr$RS.abs.w, 
"Rel.RS distrib." = fit.descr$RS.rel.w)
# Weighted and unweighted percentage of Yes per item
cbind("Weighted perc. of Yes" = fit.descr$Perc.Yes.w, 
      "Unweighted perc. of Yes" = fit.descr$Perc.Yes)
# }

Run the code above in your browser using DataLab