path_analysis
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| path_analysis [2022/11/09 21:22] – [Output] hkimscil | path_analysis [2024/09/28 05:45] (current) – hkimscil | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Path Analysis ====== | ====== Path Analysis ====== | ||
| ===== Planned Behavior Modeling ===== | ===== Planned Behavior Modeling ===== | ||
| - | < | + | < | 
| ###################################################### | ###################################################### | ||
| ## data file: PlannedBehavior.csv | ## data file: PlannedBehavior.csv | ||
| Line 27: | Line 27: | ||
| # Summarize model | # Summarize model | ||
| summary(fitmod, | summary(fitmod, | ||
| - | |||
| - | |||
| </ | </ | ||
| ====== Output ====== | ====== Output ====== | ||
| - | <coce> | + | <code> | 
| ###################################################### | ###################################################### | ||
| > ## data file: PlannedBehavior.csv | > ## data file: PlannedBehavior.csv | ||
| Line 140: | Line 138: | ||
|                     |                     | ||
|     intention  |     intention  | ||
| + | </ | ||
| + | |||
| + | ====== Model 2 ====== | ||
| + | < | ||
| + | # Specify model | ||
| + | specmod2 <- " | ||
| + | intention ~ attitude + norms + control  | ||
| + | attitude ~~ norms + control | ||
| + | norms ~~ control  | ||
| + | " | ||
| + | # Estimate model | ||
| + | fitmod2 <- sem(specmod2, | ||
| + | |||
| + | # Summarize model | ||
| + | summary(fitmod2, | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | fitmod <- lm(intention ~ attitude + norms + control, data=df) | ||
| + | summary(fitmod) | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | |||
| + | > # Specify model | ||
| + | > specmod2 <- " | ||
| + | + intention ~ attitude + norms + control  | ||
| + | + attitude ~~ norms + control | ||
| + | + norms ~~ control  | ||
| + | + " | ||
| + | > # Estimate model | ||
| + | > fitmod2 <- sem(specmod2, | ||
| + | > | ||
| + | > # Summarize model | ||
| + | > summary(fitmod2, | ||
| + | lavaan 0.6-9 ended normally after 17 iterations | ||
| + | |||
| + |   Estimator  | ||
| + |   Optimization method  | ||
| + |   Number of model parameters  | ||
| + |                                                        | ||
| + |   Number of observations  | ||
| + |                                                        | ||
| + | Model Test User Model: | ||
| + |                                                        | ||
| + |   Test statistic  | ||
| + |   Degrees of freedom  | ||
| + | |||
| + | Model Test Baseline Model: | ||
| + | |||
| + |   Test statistic  | ||
| + |   Degrees of freedom  | ||
| + |   P-value  | ||
| + | |||
| + | User Model versus Baseline Model: | ||
| + | |||
| + | Comparative Fit Index (CFI) 1.000 | ||
| + | Tucker-Lewis Index (TLI) 1.000 | ||
| + | |||
| + | Loglikelihood and Information Criteria: | ||
| + | |||
| + | Loglikelihood user model (H0) -1011.828 | ||
| + | Loglikelihood unrestricted model (H1) -1011.828 | ||
| + |                                                        | ||
| + | Akaike (AIC) 2043.656 | ||
| + | Bayesian (BIC) 2076.589 | ||
| + |   Sample-size adjusted Bayesian (BIC)          | ||
| + | |||
| + | Root Mean Square Error of Approximation: | ||
| + | |||
| + | RMSEA 0.000 | ||
| + | 90 Percent confidence interval - lower 0.000 | ||
| + | 90 Percent confidence interval - upper 0.000 | ||
| + | P-value RMSEA <= 0.05 NA | ||
| + | |||
| + | Standardized Root Mean Square Residual: | ||
| + | |||
| + | SRMR 0.000 | ||
| + | |||
| + | Parameter Estimates: | ||
| + | |||
| + |   Standard errors  | ||
| + |   Information  | ||
| + | Information saturated (h1) model Structured | ||
| + | |||
| + | Regressions: | ||
| + |                     | ||
| + | intention ~ | ||
| + |     attitude  | ||
| + |     norms              | ||
| + |     control  | ||
| + | |||
| + | Covariances: | ||
| + |                     | ||
| + | attitude ~~ | ||
| + |     norms              | ||
| + |     control  | ||
| + |   norms ~~                                             | ||
| + |     control  | ||
| + | |||
| + | Variances: | ||
| + |                     | ||
| + |     | ||
| + |     attitude  | ||
| + |     norms              | ||
| + |     control  | ||
| + | |||
| + | R-Square: | ||
| + |                     | ||
| + |     intention  | ||
| + | |||
| + | > | ||
| + | > fitmod <- lm(intention ~ attitude + norms + control, data=df) | ||
| + | > summary(fitmod) | ||
| + | |||
| + | Call: | ||
| + | lm(formula = intention ~ attitude + norms + control, data = df) | ||
| + | |||
| + | Residuals: | ||
| + |       | ||
| + | -1.80282 -0.52734 -0.06018  | ||
| + | |||
| + | Coefficients: | ||
| + |             Estimate Std. Error t value Pr(> | ||
| + | (Intercept)  | ||
| + | attitude  | ||
| + | norms        0.15250  | ||
| + | control  | ||
| + | --- | ||
| + | Signif. codes:  | ||
| + | |||
| + | Residual standard error: 0.7356 on 195 degrees of freedom | ||
| + | Multiple R-squared:  | ||
| + | F-statistic: | ||
| + | |||
| + | > | ||
| + | </ | ||
| + | ====== Model 3 ====== | ||
| + | < | ||
| + | # Specify model | ||
| + | specmod3 <- " | ||
| + | # directional relationships | ||
| + |   intention ~ attitude + norms + control  | ||
| + | behavior ~ intention | ||
| + |    | ||
| + | # covariances | ||
| + | attitude ~~ norms + control | ||
| + |   norms ~~ control  | ||
| + | " | ||
| + | # Estimate model | ||
| + | fitmod3 <- sem(specmod3, | ||
| + | |||
| + | # Summarize model | ||
| + | summary(fitmod3, | ||
| + | </ | ||
| + | < | ||
| + | > df <- read.csv(" | ||
| + | > # Specify model | ||
| + | > specmod3 <- " | ||
| + | + # directional relationships | ||
| + | +    | ||
| + | +    | ||
| + | + | ||
| + | + # covariances | ||
| + | +    | ||
| + | +   norms ~~ control  | ||
| + | + " | ||
| + | > # Estimate model | ||
| + | > fitmod3 <- sem(specmod3, | ||
| + | > | ||
| + | > # Summarize model | ||
| + | > summary(fitmod3, | ||
| + | lavaan 0.6-12 ended normally after 18 iterations | ||
| + | |||
| + |   Estimator  | ||
| + |   Optimization method  | ||
| + |   Number of model parameters  | ||
| + | |||
| + |   Number of observations  | ||
| + | |||
| + | Model Test User Model: | ||
| + |                                                        | ||
| + |   Test statistic  | ||
| + |   Degrees of freedom  | ||
| + |   P-value (Chi-square)  | ||
| + | |||
| + | Model Test Baseline Model: | ||
| + | |||
| + |   Test statistic  | ||
| + |   Degrees of freedom  | ||
| + |   P-value  | ||
| + | |||
| + | User Model versus Baseline Model: | ||
| + | |||
| + | Comparative Fit Index (CFI) 1.000 | ||
| + | Tucker-Lewis Index (TLI) 1.019 | ||
| + | |||
| + | Loglikelihood and Information Criteria: | ||
| + | |||
| + | Loglikelihood user model (H0) -1258.517 | ||
| + | Loglikelihood unrestricted model (H1) -1257.506 | ||
| + |                                                        | ||
| + | Akaike (AIC) 2541.035 | ||
| + | Bayesian (BIC) 2580.555 | ||
| + |   Sample-size adjusted Bayesian (BIC)          | ||
| + | |||
| + | Root Mean Square Error of Approximation: | ||
| + | |||
| + | RMSEA 0.000 | ||
| + | 90 Percent confidence interval - lower 0.000 | ||
| + | 90 Percent confidence interval - upper 0.103 | ||
| + | P-value RMSEA <= 0.05 0.735 | ||
| + | |||
| + | Standardized Root Mean Square Residual: | ||
| + | |||
| + | SRMR 0.019 | ||
| + | |||
| + | Parameter Estimates: | ||
| + | |||
| + |   Standard errors  | ||
| + |   Information  | ||
| + | Information saturated (h1) model Structured | ||
| + | |||
| + | Regressions: | ||
| + |                     | ||
| + | intention ~ | ||
| + |     attitude  | ||
| + |     norms              | ||
| + |     control  | ||
| + |   behavior ~                                           | ||
| + |     intention  | ||
| + | |||
| + | Covariances: | ||
| + |                     | ||
| + | attitude ~~ | ||
| + |     norms              | ||
| + |     control  | ||
| + |   norms ~~                                             | ||
| + |     control  | ||
| + | |||
| + | Variances: | ||
| + |                     | ||
| + |     | ||
| + |     | ||
| + |     attitude  | ||
| + |     norms              | ||
| + |     control  | ||
| + | |||
| + | R-Square: | ||
| + |                     | ||
| + |     intention  | ||
| + |     behavior  | ||
| + | |||
| + | </ | ||
| + | |||
| + | < | ||
| + | a <- (5*(5+1))/2 | ||
| + | b <- 12 | ||
| + | a-b | ||
| + | |||
| </ | </ | ||
path_analysis.1667996529.txt.gz · Last modified:  by hkimscil
                
                