knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(metaRmat)
becker09
becker09_list <- df_to_corr(becker09, variables = c('Cognitive_Performance', 'Somatic_Performance', 'Selfconfidence_Performance', 'Somatic_Cognitive', 'Selfconfidence_Cognitive', 'Selfconfidence_Somatic'), ID = 'ID')
olkin_siotani(becker09_list, becker09$N, type = 'simple') olkin_siotani(becker09_list, becker09$N, type = 'average') olkin_siotani(becker09_list, becker09$N, type = 'weighted')
input_metafor <- prep_data(becker09, becker09$N, type = 'weighted', variable_names = c('Cognitive_Performance', 'Somatic_Performance', 'Selfconfidence_Performance', 'Somatic_Cognitive', 'Selfconfidence_Cognitive', 'Selfconfidence_Somatic'), ID = 'ID') fixed_model <- fit_model(data = input_metafor, effect_size = 'yi', var_cor = 'V', moderators = ~ -1 + factor(outcome), random_params = NULL) random_model <- fit_model(data = input_metafor, effect_size = 'yi', var_cor = 'V', moderators = ~ -1 + factor(outcome), random_params = ~ factor(outcome) | factor(study))
model_out_fixed <- extract_model(fixed_model, variable_names = c('Cognitive_Performance', 'Somatic_Performance', 'Selfconfidence_Performance', 'Somatic_Cognitive', 'Selfconfidence_Cognitive', 'Selfconfidence_Somatic')) model_out_random <- extract_model(random_model, variable_names = c('Cognitive_Performance', 'Somatic_Performance', 'Selfconfidence_Performance', 'Somatic_Cognitive', 'Selfconfidence_Cognitive', 'Selfconfidence_Somatic'))
model <- "## Regression paths Performance ~ Cognitive + Somatic + Selfconfidence Selfconfidence ~ Cognitive + Somatic" path_output <- path_model(data = model_out_random, model = model, num_obs = 600) summary(path_output)
model <- "## Regression paths Performance ~ Cognitive + Somatic" path_output <- path_model(data = model_out_random, model = model, num_obs = 600) summary(path_output)
%>%
library(dplyr) model <- "## Regression paths Performance ~ Cognitive + Somatic + Selfconfidence Selfconfidence ~ Cognitive + Somatic" prep_data(becker09, becker09$N, type = 'weighted', variable_names = c('Cognitive_Performance', 'Somatic_Performance', 'Selfconfidence_Performance', 'Somatic_Cognitive', 'Selfconfidence_Cognitive', 'Selfconfidence_Somatic'), ID = 'ID') %>% fit_model(effect_size = 'yi', var_cor = 'V', moderators = ~ -1 + factor(outcome), random_params = ~ factor(outcome) | factor(study), structure = 'UN') %>% extract_model(variable_names = c('Cognitive_Performance', 'Somatic_Performance', 'Selfconfidence_Performance', 'Somatic_Cognitive', 'Selfconfidence_Cognitive', 'Selfconfidence_Somatic')) %>% path_model(model = model, num_obs = 600) %>% summary()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.