Search results

  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
  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. 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...
  16. Lazar

    rmongodb: Return count of all instances within a document

    I have a mongodb with 21,000 documents. The fields include: _id, dateOfSpeech, speaker, speechType, and speechTranscript. I want to construct a query of the speechTranscript field that returns the count of the number of times a given pattern occurs in a document. So far I have only been able...
  17. Lazar

    linear probability models: heteroscedasticity

    I have to run linear probability models rather than logistic regression models (dichotomous endogenous variable) and I am wanting to look for a way of dealing with heteroscedasticity to get correct standard errors. I wonder whether using robust weighted least squares in the R package lavaan for...
  18. Lazar

    GIS data questions

    Hi All, I have to get some GIS data for a project I am working on but I honestly have no idea where to start. What I need is as follows: 1. I need to get the lat and long of the point in a post/zip code with the highest population density (post codes are from Australia). I have the geographic...
  19. Lazar

    makefile knitr

    Ok so I want to make a makefile that will find all .Rmd files and convert them to html files. I have a make file the works but I want to work loop through the .Rmd and then .md files. Here is what I have so far: # test comment all: Day1Part1-Introduction.html \...
  20. Lazar

    weighted correlation

    Hi Folks, So I have data that looks like: myData <- structure(list(total = c(0.154, 0.223, 0.252, 0.157, 0.196, 0.252, 0.198, 0.162, 0.222, 0.135, 0.196, 0.193, 0.192, 0.274, 0.177, 0.17, 0.214, 0.214, 0.107, 0.22, 0.177, 0.177, 0.165, 0.226, 0.196, 0.267, 0.174, 0.12, 0.159), totalse...