lscomb: Lowering Stress by comparing combinations (lscomb)

Description Usage Arguments Details Value See Also Examples

View source: R/Modelling.R

Description

lscomb calculates Stress levels for all combinations of p out of n categories

Usage

1
2
lscomb(data, points, method = "as", single = TRUE, comments = FALSE,
  type = "ordinal", weight = TRUE)

Arguments

data

Dataset; the first column must be the ID of the unit of comparison, the other columns must be categories; see dataset requirements simi.

points

Number of categories that should be included in the model (p < n, wherein n equals the number of categories in the dataset).

method

Specifies the similarity index used to compute the similarity matrix, choose between "as" (Association Strength Index), "jaccard" (Jaccard Index), "cosine" (Cosine Index), and "inclusion" (Inclusion Index). Default is as.

single

If TRUE, single mentionings (i.e. one respondent mentioning just one category) are included when calculating the similarity matrix. Default is TRUE.

comments

If TRUE, comments relating to exclusion or possible exclusion of categories and respondents are displayed. Default is FALSE.

type

Specifies the type of MDS model used (for more details see the package 'smacof' of Mair, De Leeuw, Borg, & Groenen). Default is ordinal.

weight

If TRUE, the MDS model is calcualted using weights, i.e., similarities of zero are excluded. Default is TRUE.

Details

This function is applicable to co-occurrence data. It shows the resulting Stress values for all combinations of p out of n categories. The output consists in a table showing which categories have been included and the resulting Stress values. The table is sorted such that the lowest Stress level occurs at the top. The MDS model is computed using the package 'smacof' (Mair, De Leeuw, Borg, & Groenen). The first column of the input matrix data should contain the ID of the unit of comparison and the following columns the categories for which the similarity matrices and MDS maps are calculated (see also the description of simi). Note that the purpose of this function is to assist modeling by helping to identify potential problems. It is not, however, meant to be used for excluding categories based solely on measures of fit and without substantial justification.

Value

Matrix showing the categories included and the Stress values of the respective MDS models.

See Also

smacofSym for details on calculating MDS representations, simi for details on calculating similarity matrices.

Examples

1
2
3
4
5
6
7
## Calculate Stress values for 5 out of 7 SDGs
data(SDG_coocurrence)
SDG_coocurrence <- SDG_coocurrence[,-2] # Drop second column
input <- SDG_coocurrence[,1:8] # For computational reasons, we will work 
                               # with 7 SDGs.  
stress <- lscomb(input, points = 5)
stress

thectar documentation built on Nov. 16, 2019, 1:07 a.m.