Package 'RM.weights'

Title: Weighted Rasch Modeling and Extensions using Conditional Maximum Likelihood
Description: Rasch model and extensions for survey data, using Conditional Maximum likelihood (CML). Carlo Cafiero, Sara Viviani, Mark Nord (2018) <doi:10.1016/j.measurement.2017.10.065>.
Authors: Carlo Cafiero, Sara Viviani, Mark Nord
Maintainer: Sara Viviani <[email protected]>
License: GPL (>= 3.0.0)
Version: 2.0
Built: 2025-02-12 04:41:07 UTC
Source: https://github.com/cran/RM.weights

Help Index


Rasch model and extensions for survey data, using Conditional Maximum likelihood (CML).

Description

This package computes parameter estimates and assessment statistics of a single-parameter Rasch model for dichotomous and polytomous (partial credit) item responses using CML estimation, including optional use of sampling weights. Procedures to calculate prevalence rates of the phenomenon of interest (latent variable) and to equate item parameters across different contexts are implemented.

Details

Package: RM.weights
Type: Package
Version: 2.0
Date: 2017-11-14
License: GPL (>= 3)

Author(s)

Carlo Cafiero, Mark Nord, Sara Viviani

Maintainer: Sara Viviani <[email protected]>

Examples

## Not run: 
data(data.FAO_country1_2013)
# Questionnaire data and weights
XX = data.FAO_country1_2013[,1:8]
wt = data.FAO_country1_2013$wt
# Fit weighted Rasch
rr = RM.w(XX, wt)
pp = prob.assign(rr, sthres = seq(-5, 5, 0.01))

## End(Not run)

Food insecurity data for a GWP country (Country1).

Description

The dataset includes the FIES data (Food Insecurity Experience based Scale), sampling weights, and some demographic variables for a sample country (Country1). Data have been collected by the Gallup World Poll.

Arguments

WORRIED

FIES question n. 1. During the past 12 months, was there a time when you were worried you would run out of food because of lack of money or other resources?

HEALTHY

FIES question n. 2. During the past 12 months, was there a time when you were unable to eat healty and nutritious food because of lack of money or other resources?

FEWFOOD

FIES question n. 3. During the past 12 months, was there a time when you ate only few kinds of food because of lack of money or other resources?

SKIPPED

FIES question n. 4. During the past 12 months, was there a time when you had to skip a meal because of lack of money or other resources?

ATELESS

FIES question n. 5. During the past 12 months, was there a time when you ate less than you thought you should because of lack of money or other resources?

RUNOUT

FIES question n. 6. During the past 12 months, was there a time when your household ran out of food because of lack of money or other resources?

HUNGRY

FIES question n. 7. During the past 12 months, was there a time when you were hungry but did not eat because of lack of money or other resources?

WHLDAY

FIES question n. 8. During the past 12 months, was there a time when you went without eating for a whole day because of lack of money or other resources?

gender

Respondents' gender.

age

Respondents' age.

education

Respondents' education.

urbanrural

Respondents' area (urban or rural).

wt

Sampling weights.

Author(s)

Sara Viviani [email protected]

Examples

## Not run: 
data(data.FAO_country1)
# Matrix of questionnaire data and weights (for the Rasch analysis)
XX.country1 = data.FAO_country1[,1:8]
wt.country1 = data.FAO_country1$wt

## End(Not run)

Food insecurity data for a GWP pilot country (Country2).

Description

The dataset includes the FIES data (Food Insecurity Experience based Scale), sampling weights, and some demographic variables for a sample country (Country2). Data have been collected by the Gallup World Poll.

Arguments

WORRIED

FIES question n. 1. During the past 12 months, was there a time when you were worried you would run out of food because of lack of money or other resources?

HEALTHY

FIES question n. 2. During the past 12 months, was there a time when you were unable to eat healty and nutritious food because of lack of money or other resources?

FEWFOOD

FIES question n. 3. During the past 12 months, was there a time when you ate only few kinds of food because of lack of money or other resources?

SKIPPED

FIES question n. 4. During the past 12 months, was there a time when you had to skip a meal because of lack of money or other resources?

ATELESS

FIES question n. 5. During the past 12 months, was there a time when you ate less than you thought you should because of lack of money or other resources?

RUNOUT

FIES question n. 6. During the past 12 months, was there a time when your household ran out of food because of lack of money or other resources?

HUNGRY

FIES question n. 7. During the past 12 months, was there a time when you were hungry but did not eat because of lack of money or other resources?

WHLDAY

FIES question n. 8. During the past 12 months, was there a time when you went without eating for a whole day because of lack of money or other resources?

gender

Respondents' gender.

age

Respondents' age.

education

Respondents' education.

urbanrural

Respondents' area (urban or rural).

wt

Sampling weights.

Author(s)

Sara Viviani [email protected]

Examples

## Not run: 
data(data.FAO_country2)
# Matrix of questionnaire data and weights (for the Rasch analysis)
XX.country2 = data.FAO_country2[,1:8]
wt.country2 = data.FAO_country2$wt

## End(Not run)

Food insecurity data for a GWP pilot country (Country3).

Description

The dataset includes the FIES data (Food Insecurity Experience based Scale), sampling weights, and some demographic variables for a sample country (Country1). Data have been collected by the Gallup World Poll.

Arguments

WORRIED

FIES question n. 1. During the past 12 months, was there a time when you were worried you would run out of food because of lack of money or other resources?

HEALTHY

FIES question n. 2. During the past 12 months, was there a time when you were unable to eat healty and nutritious food because of lack of money or other resources?

FEWFOOD

FIES question n. 3. During the past 12 months, was there a time when you ate only few kinds of food because of lack of money or other resources?

SKIPPED

FIES question n. 4. During the past 12 months, was there a time when you had to skip a meal because of lack of money or other resources?

ATELESS

FIES question n. 5. During the past 12 months, was there a time when you ate less than you thought you should because of lack of money or other resources?

RUNOUT

FIES question n. 6. During the past 12 months, was there a time when your household ran out of food because of lack of money or other resources?

HUNGRY

FIES question n. 7. During the past 12 months, was there a time when you were hungry but did not eat because of lack of money or other resources?

WHLDAY

FIES question n. 8. During the past 12 months, was there a time when you went without eating for a whole day because of lack of money or other resources?

gender

Respondents' gender.

age

Respondents' age.

education

Respondents' education.

urbanrural

Respondents' area (urban or rural).

wt

Sampling weights.

Author(s)

Sara Viviani [email protected]

Examples

## Not run: 
data(data.FAO_country3)
# Matrix of questionnaire data and weights (for the Rasch analysis)
XX.country3 = data.FAO_country3[,1:8]
wt.country3 = data.FAO_country3$wt

## End(Not run)

Food insecurity data for a GWP pilot country (Country4).

Description

The dataset includes the FIES data (Food Insecurity Experience based Scale), sampling weights, and some demographic variables for a sample country (Country4). Data have been collected by the Gallup World Poll.

Arguments

WORRIED

FIES question n. 1. During the past 12 months, was there a time when you were worried you would run out of food because of lack of money or other resources?

HEALTHY

FIES question n. 2. During the past 12 months, was there a time when you were unable to eat healty and nutritious food because of lack of money or other resources?

FEWFOOD

FIES question n. 3. During the past 12 months, was there a time when you ate only few kinds of food because of lack of money or other resources?

SKIPPED

FIES question n. 4. During the past 12 months, was there a time when you had to skip a meal because of lack of money or other resources?

ATELESS

FIES question n. 5. During the past 12 months, was there a time when you ate less than you thought you should because of lack of money or other resources?

RUNOUT

FIES question n. 6. During the past 12 months, was there a time when your household ran out of food because of lack of money or other resources?

HUNGRY

FIES question n. 7. During the past 12 months, was there a time when you were hungry but did not eat because of lack of money or other resources?

WHLDAY

FIES question n. 8. During the past 12 months, was there a time when you went without eating for a whole day because of lack of money or other resources?

gender

Respondents' gender.

age

Respondents' age.

education

Respondents' education.

urbanrural

Respondents' area (urban or rural).

wt

Sampling weights.

Author(s)

Sara Viviani [email protected]

Examples

## Not run: 
data(data.FAO_country4)
# Matrix of questionnaire data and weights (for the Rasch analysis)
XX.country4 = data.FAO_country4[,1:8]
wt.country4 = data.FAO_country4$wt

## End(Not run)

Equating scales between different application contexts.

Description

This function calibrates the measure derived by a scale applied in one context (for example, country) to the metric of a reference scale, or standard (for example, the scale applied in another country, or in the same country but through a different survey, or to any other standard). The main output is the prevalence rate in the country of interest calculated at specified thresholds along the latent trait.

Usage

equating.fun(rr1, st=NULL, tol = .35, spec.com1 = 1:8, spec.com2=1:8, 
thres = NULL, maxuniq=3, write.file=FALSE, plot=FALSE, iterative=TRUE, excl.prior1=NULL,
excl.prior2=NULL, wt.spec=NULL)

Arguments

rr1

The Rasch model fitted with the RM.w function for the country of interest.

st

Item severity parameter estimates for the reference country or the standard. The number of items for the standard may differ from the number of items of the country of interest. If left unspecified, the 2014-2016 FAO global standard for the Food Insecurity Experience Scale (FIES) is set as default.

tol

Tolerance expressed in the metric of the standard, above which items are considered unique (i.e. not contributing to the common metric between the two countries). Default is 0.35.

spec.com1

A priori numbered set of comparable items for the country of iterest to the standard. Items must be specified in the same order as they are used for the comparison.

spec.com2

A priori set of comparable items for the standard. The length of spec.com1 and spec.com2 should be the same.

thres

Thresholds (along the latent trait) corresponding to which the comparable prevalence rates of the phenomenon of interest is calculated. Default is set to the 5-th and the 8-th item of the standard specified in st.

maxuniq

A priori maximum number of unique items allowed.

write.file

Logical argument. If TRUE, a csv file with the relevant information about the equating process is created in the working directory.

plot

Logical argument. If TRUE, a pdf file with a plot of the equated item severities is produced in the working directory. Default is FALSE.

iterative

Logical argument. If TRUE, an iterative process to identify which item is unique is performed. Otherwise, unique items are specified in the arguments excl.prior1 and excl.prior2 and are taken as fixed. Default is TRUE.

excl.prior1

Numbered set of fixed unique items for the country of interest. It needs to be specified only if iterative = FALSE.

excl.prior2

Numbered set of fixed unique items for the standard. It needs to be specified only if iterative = FALSE.

wt.spec

Specified post-stratification sampling weights. If left unspecified, prevalence rates will be calculated using the weighting variable rr1$wt, otherwise the variable wt.spec will be considered.

Value

scale

Scale parameter to be applied to the metric of the country of interest to be considered equivalent to the standard.

shift

Shift parameter to be applied to the metric of the country of interest to be considered equivalent to the reference country. The standardized item parameters for the country of interest will be: b.country.st=shift+scale*b.country where b.country are estimated item severities for the country of interest.

common

Vector of characters indicating if the item in the country of interest is common compared with the standard.

prevs

Prevalence rates for the country of interest, calculated at the adjusted thresholds.

probs.rs

Probability of being bejond the adjusted thresholds calculated at each raw score.

cor.comm.items

Correlation between common items.

adj.thres

Adjusted (equated) thresholds on the country metric.

standard

The standard against which the country is compared. If the st argument is left unspecified, the 2014-2016 FAO global standard for the Food Insecurity Experience scale is returned.

Author(s)

Sara Viviani [email protected]

See Also

prob.assign

Examples

data(data.FAO_country1)
XX.country1 = data.FAO_country1[,1:8]
wt.country1 = data.FAO_country1$wt
rr1=RM.w(XX.country1, wt.country1)
data(data.FAO_country2)
XX.country2 = data.FAO_country2[,1:8]
wt.country2 = data.FAO_country2$wt
rr2=RM.w(XX.country2, wt.country2)
# Iterative equating
ee1=equating.fun(rr1, st=rr2$b, thres=c(-0.28, 1.85), spec.com1=c(1:8),spec.com2=c(1:8))
# Not iterative equating: fixing WORRIED unique
ee2=equating.fun(rr1, st=rr2$b, thres=c(-0.28, 1.85),spec.com1=c(1:8),
spec.com2=c(1:8), tol = .4,iterative=FALSE,excl.prior1=1,excl.prior2=1)
# Prevalence rates
ee1$prevs
ee2$prevs

Wald test to check sampling independence under CML.

Description

This function performs a Wald test of sampling independence on item severity parameters.

Usage

EWaldtest(b1, b2, se1, se2)

Arguments

b1

Item severity vector estimated on the first sample subset.

b2

Item severity vector estimated on the second sample subset (complementary to the one used to estimate b1).

se1

Item standard errors (first sub-sample).

se2

Item standard errors (second sub-sample).

Details

This function computes the Wald test to check if the sampling independence assumption holds. The test statistics is

z=b^1b^2Var(b^1)+Var(b^2),z = \frac{\hat{b}_1 - \hat{b}_2}{\sqrt{Var(\hat{b}_1) + Var(\hat{b}_2)}},

where b^1\hat{b}_1 and b^2\hat{b}_2 are the ML item parameter estimates computed on two, randomly extracted and complementary, sub-samples of the overall sample, and Var(b^1)Var(\hat{b}_1) and Var(b^2)Var(\hat{b}_2) the corresponding variances.

The null hypothesis is of parameter estimates equality while the alternative hypothesis is bilateral (b1b2b_1 \neq b_2).

The sampling independence assumption implies that item severity parameter estimates do not depend on the analysed samples, but only on the severity of the items themselves. One way to check for this assumption is to extract two (complementary) random samples from the original sample and run the Wald test, or, more accurately, to extract B random sub-samples and observe the p-values distribution for each item.

Value

A list with the following elements:

z The z-statistics of the Wald test.
p Computed p-value of the Wald test.
tab Descriptive table with test results.

Author(s)

Sara Viviani [email protected]

See Also

RM.w

Examples

data(data.FAO_country3)
# Questionnaire data and weights
XX.country3 = data.FAO_country3[,1:8]
wt.country3 = data.FAO_country3$wt

# Split the sample in two random sub-samples
n = nrow(XX.country3)
samp1 = sample(1:n, n/2)
samp2 = setdiff(1:n, samp1)
# Fit two Rasch models on the two sub-samples
rr1 = RM.w(XX.country3[samp1, ], wt.country3[samp1])
rr2 = RM.w(XX.country3[samp2, ], wt.country3[samp2])
# Test sampling independence
EWaldtest(rr1$b, rr2$b, rr1$se.b, rr2$se.b)$tab

Item caracteristic curves computation and plotting under CML.

Description

Computation and plotting of item caracteristic curves (ICCs) under conditional maximum likelihood (CML).

Usage

ICC.fun(b, plot = FALSE)

Arguments

b

Item severity vector estimated under CML.

plot

Logical. If TRUE, the ICCs are plotted.

Value

icc Matrix of item characteristic curves. Coloumns are items and rows are severity levels.

Author(s)

Sara Viviani [email protected]

See Also

RM.w

Examples

data(data.FAO_country2)
# Questionnaire data and weights
XX.country2 = data.FAO_country2[,1:8]
wt.country2 = data.FAO_country2$wt
# Fit weighted Rasch
rr.country2 = RM.w(XX.country2, wt.country2)
b=rr.country2$b
# ICC values
icc = ICC.fun(b)$icc
# ICC plot
icc = ICC.fun(b, plot = TRUE)

Estimation of the weighted partial credit model using CML

Description

This function estimates item and raw score parameters of a partial credit Rasch model which may include both dichotomous and polytomous item responses by using weighted CML estimation. The maximum number of response categories allowed is 4. Input data should be a 0/1 matrix (1 = Yes) for the dichotomous items and 0/1/2 or 0/1/2/3 for the polytomous items. Residual correlation, fit statistics and Rasch reliability are also reported.

Usage

PC.w(XX, wt=NULL, extr=NULL, maxiter=100,minconv=.00001,country=NULL,
write.file=FALSE, recode = 0, write.iteration=FALSE)

Arguments

XX

Input data matrix or data frame. Rows represent respondents, columns represent items. Dichotomous items are coded 0/1, polytomous items are coded 0/1/2 or 0/1/2/3; negative responses must be coded as 0s. Missing values must be coded as NA.

wt

Vector of sampling weights. The length must be the same as the number of rows of XX. If left unspecified, all the individuals will be equally weighted (wt = rep(1, nrow(XX))).

extr

Optional vector for the assumption on the extreme raw score parameters. Default is 0.5 and (k-0.5), k being the maximum number of response categories.

maxiter

Maximum number of iterations for convergence when parameter estimation is performed.

minconv

Minimum difference between parameter estimates considering two consecutive iterations for convergence.

country

Optional (character) name of the dataset.

write.file

If TRUE, a CSV file with the main model results will be saved in the working directory.

recode

It can be 0, 1, 2 or 3. recode = 0 does not imply any category aggregation. recode = 1 aggregates the two more severe categories (for example, Sometimes and Always). recode=2 aggregates the two middle categories (for example, Rarely and Sometimes). recode=3 aggregates the two less severe categories (for example, Never and Rarely). Default is 0.

write.iteration

If set TRUE a CSV file with information on the iteration process is produced in the working directory.

Details

The weighted CML method is used to estimate the item and Rasch-Thurstone parameters. Respondent parameters are estimated post-hoc as maximum likelihood given the item parameters. Cases with missing responses to some items can be included, but will not be used to estimate the Rasch model. Missing responses should be coded as NA in the input data file. If the total possible raw score is higher than 15, computer precision limits may distort results.

As the parameters for the extreme raw scores (0 and k), are undefined under the CML, some assumptions are needed unless the proportions of respondents with those raw scores are so small that they can be considered to be measured without error. Vector extr gives the option to include one assumption on the pseudo-raw-score on which raw score zero will be based and one assumption on the pseudo-raw-score on which raw score k will be based. The assumption for raw score zero can be a number between 0 and 1 (extremes excluded). The assumption for raw score k can be a number between k-1 and k (extremes excluded).

Value

A list with the following elements:

b Matrix of Rasch-Thurstone (R-T) thresholds (corresponding to item severity parameters in a Rasch model for dichotomous data).
se.b Matrix of standard errors for R-T thresholds.
infit Infit statistics corresponding to each R-T threshold.
outfit Outfit statistics corresponding to each R-T threshold.
reliab Rasch reliability.
reliab.fl Rasch reliability (equally weighted across raw scores). To be used for comparisons.
RS_distr Distribution of cases across raw scores (weighted and unweighted).
res.cor Matrix of residual correlation.
a Vector of raw score parameters.
se.a Vector of raw score parameter errors (or measurement errors).
XX Data matrix (after recoding).
wt Vector of sampling weights.
d Pseudo-raw-scores used for the estimation of extreme parameters.
N_valid_w Number of cases with any valid response.
Perc_valid_w Percentage of cases with any valid response.
N_tot Total sample size.
N_compl Number of complete non-extreme cases.

Author(s)

Sara Viviani [email protected], Mark Nord [email protected]

Examples

data(data.FAO_country1)
# Questionnaire data and weights
XX.country1 = data.FAO_country1[,1:8]
XX.country1[,c(7,8)] = cbind(rbinom(nrow(XX.country1), 3, .5), rbinom(nrow(XX.country1), 3, .4)) 
wt.country1 = data.FAO_country1$wt
# Fit weighted partial credit model with aggregation of the two more severe categories
rr.country1.pol2 = PC.w(XX.country1, wt.country1, recode = 1)

Probabilistic assignment of cases to classes of severity along the latent trait.

Description

This function assigns cases probabilistically to classes of severity along the latent trait. This procedure is useful when different (cultural-geographical-linguistic) contexts are compared in terms of the prevalence of some phenomenon.

Usage

prob.assign(rr=NULL,  rwthres = NULL, sthres = NULL, 
eps.a = NULL, flex = list(a=NULL, se.a=NULL, d=NULL, XX=NULL, wt=NULL))

Arguments

rr

An object of RM.w type.

rwthres

Raw score thresholds. If this argument is specified, corresponding thresholds on the latent trait (thres) are provided as output.

sthres

Alternative argument to rwthres. Thresholds on the latent trait. If this argument is specified, probability of being beyond the specified thresholds (sprob) is provided as output.

eps.a

Tolerance for the algorithm that estimates thresholds on the latent trait corresponding to the specified thresholds in terms of raw score (rwthres). If left unspecified, the tolerance to convergence is 0.001.

flex

Alternative argument to rr. If rr=NULL, than flex needs to be specified as a list with the following arguments: a (person parameters), se.a (person parameter standard errors), d (pseudo-raw-scores for estimation of extreme raw score parameters; if left unspecified leads to estimate the k-th raw score parameter at location (k-1)+0.5), XX (input data matrix or data frame), wt (sampling weights; if left unspecified leads to sampling weights equal to one for all subjects).

Details

The probabilistic assignment procedure is particularly useful when comparing results between different populations that might have interpreted some items of a scale differently. The distribution of the raw score is assumed to be a mixture of Gaussian densities, each centred on the raw score parameters (estimated using the Rasch model) and scaled with corresponding measurement errors. The resulting (complementary) cumulative prevalence, weighted by the proportion of individuals in each raw score, is as follows:

P(x)=i=0N(1Infxfi(t)dt)pi=i=0N(1Fi(x))pi,P(x)= \sum_{i=0}^N (1-\int_{-Inf}^x f_i(t)dt) p_i = \sum_{i=0}^N (1-F_i(x)) p_i,

where fif_i is the probability density function (and FiF_i is the cumulative distribution function) of severity levels centred on raw score parameter ii and scaled with the corresponding measurement error, pip_i is the proportion observed in raw score ii, and NN is the maximum number of items. The function P(x)P(x) can be used to trace a continuous profile of prevalence on the latent trait for the phenomenon of interest. It allows to equate different metrics and it facilitates cross-cultural comparisons. The prob.assign function can be used in two ways: providing the rwthres argument, i.e. specifying thresholds in terms of raw score, it provides the estimation of the thresholds on the latent trait that correspond to the raw score thresholds; providing the sthres argument, i.e. specifying thresholds on the latent trait, it provides the probability of being beyond the specified thresholds for the population of interest.

Value

A list with the following elements:

sprob Estimated weighted probability of being beyond thresholds provided in sthres (P(x)P(x)). If sthres argument is not specified, the sprob value is NULL.
thres Thresholds on the latent trait calculated corresponding to thresholds in terms of raw-score specified in rwthres.
f Probability of being beyond the thres thresholds distributed across raw scores. If more than one assumption on the exreme raw scores is made in rr, it is a list of a number of elements equal to the number of assumptions made.
p Empirical (weighted) distribution beyond the raw scores specified in rwthres. If only one assumption on the extreme raw scores is made, then colSums(f) is approximately equal to p, where the order of approximation depends on eps.a.
f_j Empirical (weighted) distribution across the raw scores.

Author(s)

Sara Viviani [email protected], Mark Nord [email protected]

See Also

RM.w

Examples

data(data.FAO_country1)
# Questionnaire data and weights
XX.country1 = data.FAO_country1[,1:8]
wt.country1 = data.FAO_country1$wt
# Fit weighted Rasch
rr.country1 = RM.w(XX.country1, wt.country1)

# Thresholds on the latent trait corresponding to a given raw score
pp.country1 = prob.assign(rr.country1, rwthres = c(3, 7))

# Table with prevalences and thresholds
tab = cbind("Raw score" = c(3, 7), "Latent trait" =  pp.country1$thres, 
"Prevalence" = colSums(pp.country1$f))
rownames(tab) = c("Thres 1","Thres 2")
tab

# Pre-defined thresholds on the latent trait
sthresh = c(-0.25, 1.81)
pp.country1.2 = prob.assign(rr.country1, sthres = sthresh)$sprob
# Probability of being beyond -0.25 on the latent trait in country 1 
pp.country1.2[1]*100
# Probability of being beyond 1.81 on the latent trait in country 1 
pp.country1.2[2]*100

# More than 2 extremes
# Fit the model
rr.country1.d = RM.w(XX.country1, wt.country1, .d = c(0.5, 7.5, 7.7))
# Probabilistic assignment
pp.country1.d = prob.assign(rr.country1.d, sthres = sthresh)$sprob
# Probability of being beyond -0.25 on the latent trait in country 1 
# using upper assumption on the extreme raw score parameter 8
pp.country1.d[[1]]*100
# Probability of being beyond -0.25 on the latent trait in country 1 
# using lower assumption on the extreme raw score parameter 8
pp.country1.d[[2]]*100

Estimation of the weighted Rasch model using CML

Description

This function computes item and raw score parameter estimates of a Rasch model for binary item responses by using weighted CML estimation. Input data should be a 0/1 matrix (1 = Yes). Residual correlation, fit statistics and corresponding standard errors, Rasch reliability and individual fit statistics are also reported.

Usage

RM.w(.data, .w = NULL, .d=NULL, country=NULL, se.control = TRUE, 
quantile.seq = NULL, write.file = FALSE, max.it=100)

Arguments

.data

Input 0/1 data matrix or data frame; affirmative responses must be coded as 1s. Rows represent respondents, columns represent items. Missing values must be coded as NA.

.w

Vector of sampling weights. The length must be the same as the number of rows of .data. If left unspecified, all the individuals will be equally weighted (.w = rep(1, nrow(.data))).

.d

Optional vector for the assumption on the extreme raw score parameters. Default is 0.5 and (k-0.5), k being the maximum number of items (columns of .data).

country

Optional (character) name of the dataset.

se.control

Are the measurement errors for respondent extreme parameters to be calculated based on raw scores 0.5 and (k-0.5)? If FALSE, measurement errors for those parameters are based on the pseudo-raw-scores specified in the .d vector. Default is TRUE.

quantile.seq

Quantiles corresponding to the observed and the expected individual fit statistic distributions. Default is seq(0,1,0.01).

write.file

If TRUE, a CSV file with the main results will be saved in the working directory.

max.it

Maximum number of iterations item parameters' estimation.

Details

The weighted CML method is used to estimate the item parameters. Respondent parameters are estimated post-hoc as maximum likelihood given the item parameters. Cases with missing responses to some items can be included in the input data, but will not be used to estimate the Rasch model. Missing responses should be coded as NA in the input data file.

As the parameters for the extreme raw scores (0 and k), are undefined under the CML, some assumptions are needed unless the proportions of respondents with those raw scores are so small that they can be considered to be measured without error. Vector .d gives the option to include up to four alternative assumptions on the pseudo-raw-scores on which calculation of parameters for extreme raw scores will be based. More in detail, .d can be a two, three or four element vector:

  • If length(.d) = 4, then the first two elements must refer to the assumptions for raw score 0, and the second two elements for raw score k. For instance .d = c(0.1, 0.7, 7.1, 7.6), if the maximum raw score is 8.

  • If length(.d) = 3, then the first two elements can either refer to the assumptions upon raw score 0 or raw score k, and the last one is defined accordingly. For instance .d = c(0.1, 7.1, 7.6) or .d = c(0.1, 0.7, 7.6), if the maximum raw score is 8.

  • If length(.d) = 2, then the first element must refer to the assumption for raw score 0, and the second element for raw score k. For instance .d = c(0.1, 7.6), if the maximum raw score is 8.

Value

A list with the following elements:

country Name of the country or the application.
b Item severity parameters.
a Raw score severity parameters.
se.b Item severities' standard error.
se.a Raw score parameters' standard error.
infit Items' infit statistics.
outfit Items' outfit statistics.
reliab Rasch reliability.
reliab.fl Rasch reliability (equally weighted across raw scores).
infit.person Respondents' infits.
outfit.person Respondents' outfits.
q.infit.theor Quintiles of theoretical person infits.
q.infit Quintiles of person infits.
q.outfit.theor Quintiles of theoretical person outfits.
q.outfit Quintiles of person outfits.
res.corr Residual correlation matrix.
se.infit Standard errors of infits.
mat.res Matrix of individual residuals for each item.
d Pseudo raw scores for the calculation of extreme raw score parameters.
XX Data matrix.
wt Vector of post-stratification sampling weights.
n.compl Number of complete, non-extreme cases.
wt.rs Weighted (absolute) distribution of respondents across raw scores.
wt.rs Weighted (relative) distribution of respondents across raw scores.
converged Character indicating if the item estimation algorithm has reached convergence or the maximum number of iterations has been reached without convergence.

Author(s)

Sara Viviani [email protected], Mark Nord [email protected]

Examples

data(data.FAO_country1)
# Questionnaire data and weights
XX.country1 = data.FAO_country1[,1:8]
wt.country1 = data.FAO_country1$wt
# Fit weighted Rasch
rr.country1 = RM.w(XX.country1, wt.country1)
# Fit unweighted Rasch
rr.country1.nw = RM.w(XX.country1)

# Item severity
rr.country1$b

# Item standard error
rr.country1$se.b

# Respondent severity for each raw score
rr.country1$a

# Respondent measurement error for each raw score
rr.country1$se.a

# Item infit  
rr.country1$infit

# Item outfit 
rr.country1$outfit

# Rasch reliability based on observed distribution of cases across raw scores
rr.country1$reliab

# Rasch reliability  based on equal proportion of cases in each 
# non-extreme raw score (more comparable across datasets)
rr.country1$reliab.fl

# Checking conditional independence: residual correlation matrix 
rr.country1$res.cor

Rasch-Thurstone thresholds for trichotomous scales under CML.

Description

Computes the Rasch-Thurstone thresholds for the CML estimation, starting from Rasch thresholds of a trichotomous scale.

Usage

RT.thres(R.thres)

Arguments

R.thres

Vector of rasch thresholds of a trichotomous scale, i.e. points on the latent trait corresponding to which the caracteristic curves of two consecutive categories cross.

Details

The Rasch-Thurstone (R-T) threshold for a given response category of an item is defined as the point on the latent trait at which the combined probability of response in that category and all more severe categories is .5. Conceptually, an R-T threshold for a given response category for a trichotomous item is comparable with the item severity parameter estimated for a dichotomous item coded 1 for that and all more severe categories and 0 for all less severe categories.

Value

A list with the following elements:

b1.rt R-T threshold for the first category.
b2.rt R-T threshold for the second category.
b12.rt Vector of R-T thresholds for the first and second category.

Author(s)

Sara Viviani [email protected], Mark Nord [email protected]


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.

Author(s)

Sara Viviani [email protected]

Examples

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)