xmu_twin_add_WeightMatrices: Add weight matrices to twin models.

View source: R/xmu_make_top_twin_models.R

xmu_twin_add_WeightMatricesR Documentation

Add weight matrices to twin models.

Description

Add weight models (MZw, DZw) with matrices (e.g. mzWeightMatrix) to a twin model, and update mxFitFunctionMultigroup. This yields a weighted model with vector objective.

To weight objective functions in OpenMx, you specify a container model that applies the weights m1 is the model with no weights, but with "vector = TRUE" option added to the FIML objective. This option makes FIML return individual likelihoods for each row of the data (rather than a single -2LL value for the model) You then optimize weighted versions of these likelihoods by building additional models containing weight data and an algebra that multiplies the likelihoods from the first model by the weight vector.

Usage

xmu_twin_add_WeightMatrices(model, mzWeights = NULL, dzWeights = NULL)

Arguments

model

umx-style twin model

mzWeights

data for MZ weights matrix

dzWeights

data for DZ weights matrix

Value

  • model

See Also

Other xmu internal not for end user: umxModel(), umxRenameMatrix(), umx_APA_pval(), umx_fun_mean_sd(), umx_get_bracket_addresses(), umx_make(), umx_standardize(), umx_string_to_algebra(), xmuHasSquareBrackets(), xmuLabel_MATRIX_Model(), xmuLabel_Matrix(), xmuLabel_RAM_Model(), xmuMI(), xmuMakeDeviationThresholdsMatrices(), xmuMakeOneHeadedPathsFromPathList(), xmuMakeTwoHeadedPathsFromPathList(), xmuMaxLevels(), xmuMinLevels(), xmuPropagateLabels(), xmuRAM2Ordinal(), xmuTwinSuper_Continuous(), xmuTwinSuper_NoBinary(), xmuTwinUpgradeMeansToCovariateModel(), xmu_CI_merge(), xmu_CI_stash(), xmu_DF_to_mxData_TypeCov(), xmu_PadAndPruneForDefVars(), xmu_bracket_address2rclabel(), xmu_cell_is_on(), xmu_check_levels_identical(), xmu_check_needs_means(), 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_print_algebras(), xmu_rclabel_2_bracket_address(), 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_summary_RAM_group_parameters(), xmu_twin_check(), xmu_twin_get_var_names(), xmu_twin_make_def_means_mats_and_alg(), xmu_twin_upgrade_selDvs2SelVars()

Examples

tmp = umx_make_twin_data_nice(data=twinData, sep="", zygosity="zygosity", numbering= 1:2)
m1  = umxACE(selDVs = "wt", data = tmp, dzData = "DZFF", mzData = "MZFF", autoRun= FALSE)
m1$MZ$fitfunction$vector= TRUE

tmp = xmu_twin_add_WeightMatrices(m1,
	mzWeights= rnorm(nrow(m1$MZ$data$observed)), 
	dzWeights= rnorm(nrow(m1$DZ$data$observed))
)


tbates/umx documentation built on April 10, 2024, 8:14 p.m.