me_cmv_cov accepts an medesign object specified in medesign and adjusts the covariance coefficients of common method variables with the reliability and validity coefficients from me_data as well as the quality of sum scores.

me_cmv_cov(.medesign)

Arguments

.medesign

An medesign object given by medesign

Value

The common-method-variance and quality corrected covariance matrix.

See also

link{medesign} and me_cmv_cor for the same adjustment but for a correlation matrix.

Examples


set.seed(2131)

# measurement data extract from SQP for Spain, Round 7 in Spanish
me_data <-
data.frame(
  question = c("ppltrst", "polintr", "trstprl", "trstplt", "trstprt", "stfedu", "stfhlth"),
  reliability = c(0.737, 0.624, 0.812, 0.852, 0.858, 0.757, 0.76),
  validity = c(0.952, 0.964, 0.959, 0.965, 0.956, 0.838, 0.798),
  quality = c(0.702, 0.601, 0.779, 0.822, 0.821, 0.635, 0.607)
)

# Define a measurement error model with two sum scores
# and sharing a common method variance between ppltrst
# and the zpoltrst sum score
m1 <- "std(zserv) = stfhlth + stfedu;
       std(zpoltrst) = trstprl + trstplt + trstprt;
       ~~ .;
       ~ ppltrst + zpoltrst"

# Create measurement error design
mdes <-
  medesign(
    model_syntax = m1,
    .data = ess7es[me_data$question],
    me_data = me_data
  )
#> Correcting for measurement error in ppltrst, polintr, zserv, zpoltrst. If you want to correct other variables, make sure they are both in `me_data` and `.data` and you specify their names in the model syntax (`~~`).

mdes
#> <Measurement error design>
#> Parsed model:
#>    zpoltrst = trstprl+trstplt+trstprt
#>    zserv = stfhlth+stfedu
#>    ~~ ppltrst + polintr + zserv + zpoltrst
#>    ~ ppltrst + zpoltrst

# Original covariance matrix
me_covariance(mdes$.data)
#> # A tibble: 4 × 5
#>   rowname  ppltrst polintr   zserv zpoltrst
#>   <chr>      <dbl>   <dbl>   <dbl>    <dbl>
#> 1 ppltrst    4.35  -0.395   0.357     1.05 
#> 2 polintr   -0.395  0.881  -0.0142   -0.502
#> 3 zserv      0.357 -0.0142  3.19      2.00 
#> 4 zpoltrst   1.05  -0.502   2.00      7.11 

# Coefficients of covariance changes
# when adjusting for common method variance and
# quality of sum scores
me_cmv_cov(mdes)
#> # A tibble: 4 × 5
#>   rowname  ppltrst polintr   zserv zpoltrst
#>   <chr>      <dbl>   <dbl>   <dbl>    <dbl>
#> 1 ppltrst    3.05  -0.608   0.428     1.21 
#> 2 polintr   -0.608  0.530  -0.0184   -0.650
#> 3 zserv      0.428 -0.0184  1.51      2.02 
#> 4 zpoltrst   1.21  -0.650   2.02      5.72