Recent content by Lazar

  1. Lazar

    Factor loadings > 1 in CFA with lavaan

    In passing with measure of the big 5 you might want to try EFA or ESEM for more complicated models given known issues with model fit for the Big 5 in CFA models.
  2. Lazar

    Factor loadings > 1 in CFA with lavaan

    Not quite. Remember the diagrams of a CFA. The arrows go from the latents to the items not the other way around. Hence, correlation between the items is not the issue here but the correlation between the latents.
  3. Lazar

    Factor loadings > 1 in CFA with lavaan

    Factor loadings in a CFA with multiple correlated latent factors are akin to regression estimates not correlations, so having a loading over 1 is possible. Whether or not it is a concern is hard to say without more context.
  4. Lazar

    formatting issues

    You might want to give us something to work with. Can you post the output of : dput(head(mydata)) before you try manipulating the dates?
  5. Lazar

    Compare non-latent variables across groups

    So your aim should be to apply your underlying theory of measurement to your data. Creating a latent variable only makes sense if your theory implies that your four variables of interest are indicators of a latent factor. So I think the best thing for you to do is provide more detail on what you...
  6. Lazar

    Compare non-latent variables across groups

    Invariance is a test of the similarity of parameters between 2 or more groups. So the question is what parameters are you interested in?
  7. Lazar

    Graphically display results of ANCOVA

    Here is a worked example using the R dataset iris: data(iris) # This will get the marginal means require(ggeffects) #This is for ploting require(ggplot2) #The model m1 <- lm(Sepal.Length ~ Sepal.Width + Species, iris) # Get the marginal means. By default will be evaluated at the mean for...
  8. Lazar

    Mediation with clustered standard errors

    Only for the summary results of the individual models. You can get those using coef_test function https://cran.r-project.org/web/packages/clubSandwich/vignettes/panel-data-CRVE.html
  9. Lazar

    Mediation with clustered standard errors

    you should just be able to say cluster="cluster_id_variable" where cluster_id_variable is the name of the column with the cluster ids.
  10. Lazar

    Mediation with clustered standard errors

    How do you want to deal with the clustering? Cluster robust standard errors, random effects, or fixed effects?
  11. Lazar

    R to collaborative Google Docs workflow ideas

    I think this might do the job. https://gist.github.com/pdparker/fecf1be5516bff4582a400e04ffba2cb but this is my first google app script so no promise that it works consistently.
  12. Lazar

    Repeated Measures RCT mediation help

    I have a repeated measures dataset with baseline and 12 and 24 month follow-up. I need to fit a mediation model to this data. I am unsure whether my approach (see below) makes sense. The questions I have are: 1. If the model has Poisson link function for the outcome is the traditional a*b...
  13. Lazar

    R to collaborative Google Docs workflow ideas

    TL;DR; I am looking for workflow ideas to dynamically import tables and figures into a google doc that I am working on collaboratively with multiple people. I find myself working a lot with colleagues on google docs who are not sufficiently familiar with R or markdown to use .Rmd files. I am...
  14. Lazar

    IV Regression with binary outcome

    I have a binary variable y which I am aiming to model using instrumental variable regression. Both X and the IV are continuous. ivpak in R does not seem to provide a means for accounting for a binary outcome. Is there a means of accounting for this in R?
  15. Lazar

    Linear Probability Models and Complex Survey Data

    So there has been a movement back toward linear probability models in cases in which multi-group comparisons are of focal interest. The rational for this is that cross-group comparisons of parameter estimates get shaky in probit and logit models requiring a bunch of finessing to get right...