Learn R Programming

umx (version 4.0.0)

xmu_check_needs_means: Check data to see if model needs means.

Description

Check data to see if model needs means.

Usage

xmu_check_needs_means(
  data,
  type = c("Auto", "FIML", "cov", "cor", "WLS", "DWLS", "ULS"),
  allContinuousMethod = c("cumulants", "marginals")
)

Arguments

data

mxData() to check.

type

of the data requested by the model.

allContinuousMethod

How data will be processed if used for WLS.

Value

  • T/F

See Also

Other xmu internal not for end user: umxModel(), umxRenameMatrix(), umxTwinMaker(), umx_APA_pval(), umx_fun_mean_sd(), umx_get_bracket_addresses(), umx_make(), umx_standardize(), umx_string_to_algebra(), umx, xmuHasSquareBrackets(), xmuLabel_MATRIX_Model(), xmuLabel_Matrix(), xmuLabel_RAM_Model(), xmuMI(), xmuMakeDeviationThresholdsMatrices(), xmuMakeOneHeadedPathsFromPathList(), xmuMakeTwoHeadedPathsFromPathList(), xmuMaxLevels(), xmuMinLevels(), xmuPropagateLabels(), xmuRAM2Ordinal(), xmuTwinSuper_Continuous(), xmuTwinUpgradeMeansToCovariateModel(), xmu_CI_merge(), xmu_CI_stash(), xmu_DF_to_mxData_TypeCov(), xmu_PadAndPruneForDefVars(), xmu_cell_is_on(), xmu_check_levels_identical(), xmu_check_variance(), xmu_clean_label(), xmu_data_missing(), xmu_data_swap_a_block(), xmu_describe_data_WLS(), xmu_dot_make_paths(), xmu_dot_make_residuals(), xmu_dot_maker(), xmu_dot_move_ranks(), xmu_dot_rank_str(), xmu_extract_column(), xmu_get_CI(), xmu_lavaan_process_group(), xmu_make_TwinSuperModel(), xmu_make_bin_cont_pair_data(), xmu_make_mxData(), xmu_match.arg(), xmu_name_from_lavaan_str(), xmu_path2twin(), xmu_path_regex(), xmu_safe_run_summary(), xmu_set_sep_from_suffix(), xmu_show_fit_or_comparison(), xmu_simplex_corner(), xmu_standardize_ACEcov(), xmu_standardize_ACEv(), xmu_standardize_ACE(), xmu_standardize_CP(), xmu_standardize_IP(), xmu_standardize_RAM(), xmu_standardize_SexLim(), xmu_standardize_Simplex(), xmu_start_value_list(), xmu_starts(), xmu_twin_add_WeightMatrices(), xmu_twin_check(), xmu_twin_get_var_names(), xmu_twin_upgrade_selDvs2SelVars()

Examples

Run this code
# NOT RUN {
xmu_check_needs_means(mtcars, type = "Auto")
xmu_check_needs_means(mtcars, type = "FIML")
# xmu_check_needs_means(mtcars, type = "cov")
# xmu_check_needs_means(mtcars, type = "cor")

# TRUE - marginals means means
xmu_check_needs_means(mtcars, type = "WLS", allContinuousMethod= "marginals")
xmu_check_needs_means(mtcars, type = "ULS", allContinuousMethod= "marginals")
xmu_check_needs_means(mtcars, type = "DWLS", allContinuousMethod= "marginals")

# ================================
# = Provided as an mxData object =
# ================================
tmp = mxData(mtcars, type="raw")
xmu_check_needs_means(tmp, type = "FIML") # TRUE
xmu_check_needs_means(tmp, type = "ULS", allContinuousMethod= "cumulants") #FALSE
# TRUE - means with marginals
xmu_check_needs_means(tmp, type = "WLS", allContinuousMethod= "marginals")
tmp = mxData(cov(mtcars), type="cov", numObs= 100)
# Should catch this can't be type FIML
xmu_check_needs_means(tmp) # FALSE
tmp = mxData(cov(mtcars), means = umx_means(mtcars), type="cov", numObs= 100)
xmu_check_needs_means(tmp) # TRUE

# =======================
# = One var is a factor =
# =======================
tmp = mtcars
tmp$cyl = factor(tmp$cyl)
xmu_check_needs_means(tmp, allContinuousMethod= "cumulants") # TRUE
xmu_check_needs_means(tmp, allContinuousMethod= "marginals") # TRUE - always has means
# }

Run the code above in your browser using DataLab