ramReFit: Refit a model with additional paths

Description Usage Arguments Examples

Description

Generate a vector field plot based on the bivariate lcsm

Usage

1
ramReFit(object, add, ram.out=FALSE, ...)

Arguments

object

Output from any data analysis

add

Additional paths to be added, e.g., add='X1~~X2'.

ram.out

Whether to print the RAM matrices

...

Options for plot and arrows function.

Examples

1
2
3
4
data(ex3)
gcm.l<-ramLCM(ex3, 1:6, model='linear', ram.out=TRUE)
## Add correlated errors
ramReFit(gcm.l, add='X1~~X2')

Example output

Loading required package: lavaan
This is lavaan 0.6-3
lavaan is BETA software! Please report any bugs.
Loading required package: ellipse

Attaching package: 'ellipse'

The following object is masked from 'package:graphics':

    pairs

Loading required package: MASS

--------------------
Parameter estimates:
--------------------

Matrix A

      X1 X2 X3 X4 X5 X6 level slope
X1     0  0  0  0  0  0     1     0
X2     0  0  0  0  0  0     1     1
X3     0  0  0  0  0  0     1     2
X4     0  0  0  0  0  0     1     3
X5     0  0  0  0  0  0     1     4
X6     0  0  0  0  0  0     1     5
level  0  0  0  0  0  0     0     0
slope  0  0  0  0  0  0     0     0

Matrix S

      X1 X2 X3 X4 X5 X6 level slope
X1    15  0  0  0  0  0     0     0
X2     0 15  0  0  0  0     0     0
X3     0  0 15  0  0  0     0     0
X4     0  0  0 15  0  0     0     0
X5     0  0  0  0 15  0     0     0
X6     0  0  0  0  0 15     0     0
level  0  0  0  0  0  0  0.17   2.3
slope  0  0  0  0  0  0  2.31   2.4

----------------------------------------
Standard errors for parameter estimates:
----------------------------------------

Matrix A

      X1 X2 X3 X4 X5 X6 level slope
X1     0  0  0  0  0  0     0     0
X2     0  0  0  0  0  0     0     0
X3     0  0  0  0  0  0     0     0
X4     0  0  0  0  0  0     0     0
X5     0  0  0  0  0  0     0     0
X6     0  0  0  0  0  0     0     0
level  0  0  0  0  0  0     0     0
slope  0  0  0  0  0  0     0     0

Matrix S

        X1   X2   X3   X4   X5   X6 level slope
X1    0.47    0    0    0    0    0     0     0
X2       0 0.47    0    0    0    0     0     0
X3       0    0 0.47    0    0    0     0     0
X4       0    0    0 0.47    0    0     0     0
X5       0    0    0    0 0.47    0     0     0
X6       0    0    0    0    0 0.47     0     0
level    0    0    0    0    0    0  0.56  0.24
slope    0    0    0    0    0    0  0.24  0.21


lavaan 0.6-3 ended normally after 53 iterations

  Optimization method                           NLMINB
  Number of free parameters                         11
  Number of equality constraints                     5

  Number of observations                           500

  Estimator                                         ML
  Model Fit Test Statistic                     978.024
  Degrees of freedom                                21
  P-value (Chi-square)                           0.000

Model test baseline model:

  Minimum Function Test Statistic             2281.743
  Degrees of freedom                                15
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.578
  Tucker-Lewis Index (TLI)                       0.698

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -8924.848
  Loglikelihood unrestricted model (H1)      -8435.836

  Number of free parameters                          6
  Akaike (AIC)                               17861.696
  Bayesian (BIC)                             17886.984
  Sample-size adjusted Bayesian (BIC)        17867.940

Root Mean Square Error of Approximation:

  RMSEA                                          0.302
  90 Percent Confidence Interval          0.286  0.318
  P-value RMSEA <= 0.05                          0.000

Standardized Root Mean Square Residual:

  SRMR                                           0.203

Parameter Estimates:

  Information                                 Expected
  Information saturated (h1) model          Structured
  Standard Errors                             Standard

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)
  level =~                                            
    X1                1.000                           
    X2                1.000                           
    X3                1.000                           
    X4                1.000                           
    X5                1.000                           
    X6                1.000                           
  slope =~                                            
    X1                0.000                           
    X2                1.000                           
    X3                2.000                           
    X4                3.000                           
    X5                4.000                           
    X6                5.000                           

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)
  level ~~                                            
    slope             2.307    0.237    9.751    0.000

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .X1                0.000                           
   .X2                0.000                           
   .X3                0.000                           
   .X4                0.000                           
   .X5                0.000                           
   .X6                0.000                           
    level            17.776    0.126  141.288    0.000
    slope             9.617    0.081  119.306    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .X1      (vare)   14.779    0.467   31.623    0.000
   .X2      (vare)   14.779    0.467   31.623    0.000
   .X3      (vare)   14.779    0.467   31.623    0.000
   .X4      (vare)   14.779    0.467   31.623    0.000
   .X5      (vare)   14.779    0.467   31.623    0.000
   .X6      (vare)   14.779    0.467   31.623    0.000
    level             0.173    0.557    0.311    0.756
    slope             2.404    0.207   11.603    0.000

Warning message:
In lav_object_post_check(object) :
  lavaan WARNING: covariance matrix of latent variables
                is not positive definite;
                use lavInspect(fit, "cov.lv") to investigate.
lavaan 0.6-3 ended normally after 61 iterations

  Optimization method                           NLMINB
  Number of free parameters                         12
  Number of equality constraints                     5

  Number of observations                           500

  Estimator                                         ML
  Model Fit Test Statistic                     972.195
  Degrees of freedom                                20
  P-value (Chi-square)                           0.000

Model test baseline model:

  Minimum Function Test Statistic             2281.743
  Degrees of freedom                                15
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.580
  Tucker-Lewis Index (TLI)                       0.685

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)              -8921.934
  Loglikelihood unrestricted model (H1)      -8435.836

  Number of free parameters                          7
  Akaike (AIC)                               17857.868
  Bayesian (BIC)                             17887.370
  Sample-size adjusted Bayesian (BIC)        17865.151

Root Mean Square Error of Approximation:

  RMSEA                                          0.309
  90 Percent Confidence Interval          0.292  0.325
  P-value RMSEA <= 0.05                          0.000

Standardized Root Mean Square Residual:

  SRMR                                           0.202

Parameter Estimates:

  Information                                 Expected
  Information saturated (h1) model          Structured
  Standard Errors                             Standard

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)
  level =~                                            
    X1                1.000                           
    X2                1.000                           
    X3                1.000                           
    X4                1.000                           
    X5                1.000                           
    X6                1.000                           
  slope =~                                            
    X1                0.000                           
    X2                1.000                           
    X3                2.000                           
    X4                3.000                           
    X5                4.000                           
    X6                5.000                           

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)
 .X1 ~~                                               
   .X2                1.964    0.784    2.505    0.012
  level ~~                                            
    slope             2.520    0.257    9.796    0.000

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)
   .X1                0.000                           
   .X2                0.000                           
   .X3                0.000                           
   .X4                0.000                           
   .X5                0.000                           
   .X6                0.000                           
    level            17.694    0.126  140.878    0.000
    slope             9.633    0.081  119.300    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .X1      (vare)   15.136    0.508   29.769    0.000
   .X2      (vare)   15.136    0.508   29.769    0.000
   .X3      (vare)   15.136    0.508   29.769    0.000
   .X4      (vare)   15.136    0.508   29.769    0.000
   .X5      (vare)   15.136    0.508   29.769    0.000
   .X6      (vare)   15.136    0.508   29.769    0.000
    level            -0.796    0.684   -1.164    0.245
    slope             2.349    0.210   11.190    0.000

NULL
Warning message:
In lav_object_post_check(object) :
  lavaan WARNING: some estimated lv variances are negative

RAMpath documentation built on May 2, 2019, 9:12 a.m.