Skip to content

Lavaan

6 messages · DzR, Sarah Goslee, David Barron +2 more

DzR
#
Dear Senior users of R/R Studio,

I am very new to this environment hence am unable to plot the SEM models including use of graphic package ggplot.

Request for some help in getting the plots please.

Thanks,

-----
Deva
#
Hi,

There are various tutorials for lavaan online, and even an entire book
on the R package. Have you worked through those examples and tutorials
successfully? If so, a clearer description of what you've tried and
what failed is required to be able to help you.

Without a reproducible example that includes some sample data (fake is
fine), the code you used, and some clear idea of what output you
expect, it's impossible to figure out how to help you. Here are some
suggestions for creating a good reproducible example:
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

Sarah
On Tue, Jun 23, 2015 at 10:48 AM, DzR <devazresearch at gmail.com> wrote:

  
    
#
i am attaching a .csv file, and the associated code worked out in R Studio.

i used the lavaan and sem packages, and conducted it.

now, i wish to draw the SEM model, as is available in AMOS other packages
and how does one draw the covariance arrows in R.

ONE STATISTICS oriented question - how can one provide interpretation for
negative coefficients.

kindly guide.

thanks and regds,





taxliability <- read.csv("~/R WORK SPACE/taxliability.csv")
Error: could not find function "sem"
This is lavaan 0.5-18
lavaan is BETA software! Please report any bugs.
Warning message:
In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  :
  lavaan WARNING: could not compute standard errors!
  lavaan NOTE: this may be a symptom that the model is not identified.
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])
:
  there is no package called ?htmlwidgets?
Error: package or namespace load failed for ?sem?
Warning message:
In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  :
  lavaan WARNING: could not compute standard errors!
  lavaan NOTE: this may be a symptom that the model is not identified.
lavaan (0.5-18) converged normally after   1 iterations

  Number of observations                            66

  Estimator                                         ML
  Minimum Function Test Statistic                0.000
  Degrees of freedom                                 0

Model test baseline model:

  Minimum Function Test Statistic              160.444
  Degrees of freedom                                 4
  P-value                                        0.000

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)              -3441.453
  Loglikelihood unrestricted model (H1)      -3441.453

  Number of free parameters                          5
  Akaike (AIC)                                6892.905
  Bayesian (BIC)                              6903.854
  Sample-size adjusted Bayesian (BIC)         6888.113

Root Mean Square Error of Approximation:

  RMSEA                                          0.000
  90 Percent Confidence Interval          0.000  0.000
  P-value RMSEA <= 0.05                          1.000

Standardized Root Mean Square Residual:

  SRMR                                           0.000

Parameter estimates:

  Information                                 Expected
  Standard Errors                             Standard

                   Estimate  Std.err  Z-value  P(>|z|)
Regressions:
  tax ~
    inc               0.103
    exp              -0.023
    svg              -0.073
    inv               0.222

Variances:
    tax           4662558.169

R-Square:

    tax               0.912

 semPlot
Error: object 'semPlot' not found
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])
:
  there is no package called ?htmlwidgets?
Error: package or namespace load failed for ?semPlot?
Error: unexpected end of line in "semPlot::"
*....*

*Deva*


...............



*in search of knowledge, everyday something is added ....*

*in search of wisdom, everyday something is dropped  ... an old Chinese
Proverb*
:::::::::::::::::::::::::

On Tue, Jun 23, 2015 at 9:03 PM, Sarah Goslee <sarah.goslee at gmail.com>
wrote:
#
Does the package semPlot not do what you want?  I notice that you got
an error when you used library(semPlot) because you don't have all the
dependencies installed. When you have semPlot working, it should be
able to produce a graphical output of the results, including
'covariance arrows'.

David
On 23 June 2015 at 17:47, deva d <devazresearch at gmail.com> wrote:
#
Have you considered using the semPlot package? It works nicely with 
lavaan models (among other sem packages). There is also the DiagrammeR 
package.

Rick
On 06/23/2015 10:48 AM, DzR wrote:

  
    
#
i tried the semPlot but it flopped. various other packages also did not
perform. i will try the DiagrammeR package and revert.

meanwhile, i tried going to the onyx package and its neat, though i have
yet to spend some time on it to familiarise myself with the nuts and bolts
of the process.




*....*

*Deva*
*F-13*
*iResearch at NITIE*
*my 'research engine' *

...............



*in search of knowledge, everyday something is added ....*

*in search of wisdom, everyday something is dropped  ... an old Chinese
Proverb*
:::::::::::::::::::::::::
On Wed, Jun 24, 2015 at 6:32 PM, Rick Bilonick <rab45 at pitt.edu> wrote: