fit.sem: Fit Simple Mediation Model - Structural Equation Modeling

Description Usage Arguments Author(s) See Also Examples

View source: R/fit.sem.R

Description

Fits the simple mediation model using structural equation modeling.

Usage

1
fit.sem(data, minimal = FALSE, std = FALSE, fiml = FALSE)

Arguments

data

n by 3 matrix or data frame. data[, 1] correspond to values for x. data[, 2] correspond to values for m. data[, 3] correspond to values for y.

minimal

Logical. If TRUE, only returns the estimate of the indirect effect ≤ft( \hat{α} \hat{β} \right). If FALSE, returns more information.

std

Logical. If TRUE, estimate standardized simple mediation model using latent variables and nonlinear constraints.

fiml

Logical. If TRUE, use missing = "fiml" to handle missing values. Note that using missing = "fiml" sets fixed.x = FALSE.

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other model fit functions: beta_fit.ols_simulation_summary(), beta_fit.ols_simulation(), beta_fit.ols_task_summary(), beta_fit.ols_task(), beta_fit.ols(), beta_fit.sem.mlr_simulation_summary(), beta_fit.sem.mlr_simulation(), beta_fit.sem.mlr_task_summary(), beta_fit.sem.mlr_task(), beta_fit.sem.mlr(), beta_std_fit.sem.mlr_simulation_summary(), beta_std_fit.sem.mlr_simulation(), beta_std_fit.sem.mlr_task_summary(), beta_std_fit.sem.mlr_task(), beta_std_fit.sem.mlr(), exp_fit.ols_simulation_summary(), exp_fit.ols_simulation(), exp_fit.ols_task_summary(), exp_fit.ols_task(), exp_fit.ols(), exp_fit.sem.mlr_simulation_summary(), exp_fit.sem.mlr_simulation(), exp_fit.sem.mlr_task_summary(), exp_fit.sem.mlr_task(), exp_fit.sem.mlr(), exp_std_fit.sem.mlr_simulation_summary(), exp_std_fit.sem.mlr_simulation(), exp_std_fit.sem.mlr_task_summary(), exp_std_fit.sem.mlr_task(), exp_std_fit.sem.mlr(), fit.cov(), fit.ols(), fit.sem.mlr(), mvn_fit.ols_simulation_summary(), mvn_fit.ols_simulation(), mvn_fit.ols_task_summary(), mvn_fit.ols_task(), mvn_fit.ols(), mvn_fit.sem_simulation_summary(), mvn_fit.sem_simulation(), mvn_fit.sem_task_summary(), mvn_fit.sem_task(), mvn_fit.sem(), mvn_mar_10_fit.sem_simulation_summary(), mvn_mar_10_fit.sem_simulation(), mvn_mar_10_fit.sem_task_summary(), mvn_mar_10_fit.sem_task(), mvn_mar_10_fit.sem(), mvn_mar_20_fit.sem_simulation_summary(), mvn_mar_20_fit.sem_simulation(), mvn_mar_20_fit.sem_task_summary(), mvn_mar_20_fit.sem_task(), mvn_mar_20_fit.sem(), mvn_mar_30_fit.sem_simulation_summary(), mvn_mar_30_fit.sem_simulation(), mvn_mar_30_fit.sem_task_summary(), mvn_mar_30_fit.sem_task(), mvn_mar_30_fit.sem(), mvn_mcar_10_fit.sem_simulation_summary(), mvn_mcar_10_fit.sem_simulation(), mvn_mcar_10_fit.sem_task_summary(), mvn_mcar_10_fit.sem_task(), mvn_mcar_10_fit.sem(), mvn_mcar_20_fit.sem_simulation_summary(), mvn_mcar_20_fit.sem_simulation(), mvn_mcar_20_fit.sem_task_summary(), mvn_mcar_20_fit.sem_task(), mvn_mcar_20_fit.sem(), mvn_mcar_30_fit.sem_simulation_summary(), mvn_mcar_30_fit.sem_simulation(), mvn_mcar_30_fit.sem_task_summary(), mvn_mcar_30_fit.sem_task(), mvn_mcar_30_fit.sem(), mvn_mnar_10_fit.sem_simulation_summary(), mvn_mnar_10_fit.sem_simulation(), mvn_mnar_10_fit.sem_task_summary(), mvn_mnar_10_fit.sem_task(), mvn_mnar_10_fit.sem(), mvn_mnar_20_fit.sem_simulation_summary(), mvn_mnar_20_fit.sem_simulation(), mvn_mnar_20_fit.sem_task_summary(), mvn_mnar_20_fit.sem_task(), mvn_mnar_20_fit.sem(), mvn_mnar_30_fit.sem_simulation_summary(), mvn_mnar_30_fit.sem_simulation(), mvn_mnar_30_fit.sem_task_summary(), mvn_mnar_30_fit.sem_task(), mvn_mnar_30_fit.sem(), mvn_std_fit.sem_simulation_summary(), mvn_std_fit.sem_simulation(), mvn_std_fit.sem_task_summary(), mvn_std_fit.sem_task(), mvn_std_fit.sem(), vm_mod_fit.ols_simulation_summary(), vm_mod_fit.ols_simulation(), vm_mod_fit.ols_task_summary(), vm_mod_fit.ols_task(), vm_mod_fit.ols(), vm_mod_fit.sem.mlr_simulation_summary(), vm_mod_fit.sem.mlr_simulation(), vm_mod_fit.sem.mlr_task_summary(), vm_mod_fit.sem.mlr_task(), vm_mod_fit.sem.mlr(), vm_mod_std_fit.sem.mlr_simulation_summary(), vm_mod_std_fit.sem.mlr_simulation(), vm_mod_std_fit.sem.mlr_task_summary(), vm_mod_std_fit.sem.mlr_task(), vm_mod_std_fit.sem.mlr(), vm_sev_fit.ols_simulation_summary(), vm_sev_fit.ols_simulation(), vm_sev_fit.ols_task_summary(), vm_sev_fit.ols_task(), vm_sev_fit.ols(), vm_sev_fit.sem.mlr_simulation_summary(), vm_sev_fit.sem.mlr_simulation(), vm_sev_fit.sem.mlr_task_summary(), vm_sev_fit.sem.mlr_task(), vm_sev_fit.sem.mlr(), vm_sev_std_fit.sem.mlr_simulation_summary(), vm_sev_std_fit.sem.mlr_simulation(), vm_sev_std_fit.sem.mlr_task_summary(), vm_sev_std_fit.sem.mlr_task(), vm_sev_std_fit.sem.mlr()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
library(lavaan)
summary(fit.sem(data = jeksterslabRdatarepo::thirst))
summary(fit.sem(data = jeksterslabRdatarepo::thirst, std = TRUE))
summary(fit.sem(data = jeksterslabRdatarepo::thirst, minimal = TRUE))
summary(fit.sem(data = jeksterslabRdatarepo::thirst, minimal = TRUE, std = TRUE))

taskid <- 1
data <- mvn_dat(taskid = taskid)

# Unstandaradized ##################################################
# Complete Data ----------------------------------------------------
summary(fit.sem(data = data))

# Missing completely at random -------------------------------------
## 10% missing
summary(fit.sem(data = mvn_mcar_10_dat(data = data, taskid = taskid), fiml = TRUE))

## 20% missing
summary(fit.sem(data = mvn_mcar_20_dat(data = data, taskid = taskid), fiml = TRUE))

## 30% missing
summary(fit.sem(data = mvn_mcar_30_dat(data = data, taskid = taskid), fiml = TRUE))

# Missing at random ------------------------------------------------
## 10% missing
summary(fit.sem(data = mvn_mar_10_dat(data = data, taskid = taskid), fiml = TRUE))

## 20% missing
summary(fit.sem(data = mvn_mar_20_dat(data = data, taskid = taskid), fiml = TRUE))

## 30% missing
summary(fit.sem(data = mvn_mar_30_dat(data = data, taskid = taskid), fiml = TRUE))

# Missing Not at random --------------------------------------------
## 10% missing
summary(fit.sem(data = mvn_mnar_10_dat(data = data, taskid = taskid), fiml = TRUE))

## 20% missing
summary(fit.sem(data = mvn_mnar_20_dat(data = data, taskid = taskid), fiml = TRUE))

## 30% missing
summary(fit.sem(data = mvn_mnar_30_dat(data = data, taskid = taskid), fiml = TRUE))

# Standaradized ####################################################
# Complete Data ----------------------------------------------------
summary(fit.sem(data = data, std = TRUE))

# Missing completely at random -------------------------------------
## 10% missing
summary(fit.sem(data = mvn_mcar_10_dat(data = data, taskid = taskid), std = TRUE, fiml = TRUE))

## 20% missing
summary(fit.sem(data = mvn_mcar_20_dat(data = data, taskid = taskid), std = TRUE, fiml = TRUE))

## 30% missing
summary(fit.sem(data = mvn_mcar_30_dat(data = data, taskid = taskid), std = TRUE, fiml = TRUE))

# Missing at random ------------------------------------------------
## 10% missing
summary(fit.sem(data = mvn_mar_10_dat(data = data, taskid = taskid), std = TRUE, fiml = TRUE))

## 20% missing
summary(fit.sem(data = mvn_mar_20_dat(data = data, taskid = taskid), std = TRUE, fiml = TRUE))

## 30% missing
summary(fit.sem(data = mvn_mar_30_dat(data = data, taskid = taskid), std = TRUE, fiml = TRUE))

# Missing Not at random --------------------------------------------
## 10% missing
summary(fit.sem(data = mvn_mnar_10_dat(data = data, taskid = taskid), std = TRUE, fiml = TRUE))

## 20% missing
summary(fit.sem(data = mvn_mnar_20_dat(data = data, taskid = taskid), std = TRUE, fiml = TRUE))

## 30% missing
summary(fit.sem(data = mvn_mnar_30_dat(data = data, taskid = taskid), std = TRUE, fiml = TRUE))

jeksterslabds/jeksterslabRmedsimple documentation built on Oct. 16, 2020, 11:30 a.m.