Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more estimators and change the optioning for estimators, test, and SEs #248

Merged
merged 19 commits into from
Sep 26, 2024

Conversation

juliuspfadt
Copy link
Contributor

@juliuspfadt juliuspfadt commented Aug 9, 2024

So essentially what happens through this PR:

What is a bit difficult is that some of the estimators change not only the estimation method, but also the model test and the standard error calculation. What is interesting is, if model test and standard errors are actually specified, beyond the default, their specification overwrites the estimator specification.

@Kucharssim maybe you have some feedback :)

toDo:

  • More testing
  • extend the options to the other SEM analyses (lgcm, mediation etc.)
  • handle ordinal data
  • help file
  • I wonder about Upgrades.qml... if we need changes there. So far it seems fine.

@FBartos
Copy link
Contributor

FBartos commented Aug 22, 2024

holly molly, I don't wanna be reviewing this!

@juliuspfadt juliuspfadt marked this pull request as ready for review August 28, 2024 12:41
Copy link
Contributor

@FBartos FBartos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly snake_case to camelCase changes needed, still gonna check the issues in JASP

R/common.R Outdated
return(lavaan::coef(lav_object))
}

coef_with_callback_std <- function(lav_object, typeStd) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coefWithCallbackStd ?

R/common.R Outdated

# Add the bootstrap samples to the fit object
fit@boot <- list(coef = bootres)
fit@Options$se <- "bootstrap"

# exclude error bootstrap runs
err_id <- attr(fit@boot$coef, "error.idx")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errId ?

R/sem.R Outdated Show resolved Hide resolved
R/sem.R Outdated
} else {
lav_args[["sample.cov"]] <- .semDataCovariance(dataset, options[["models"]][[i]][["syntax"]])
cov_mat <- .semDataCovariance(dataset, options[["models"]][[i]][["syntax"]])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

covMat ?

R/sem.R Outdated
if (options[["standardizedVariable"]]) {
dataset <- scale(dataset)
}
lav_args[["data"]] <- dataset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lavaanArgs ?

R/sem.R Show resolved Hide resolved
inst/qml/SEM.qml Outdated Show resolved Hide resolved
@FBartos
Copy link
Contributor

FBartos commented Aug 28, 2024

  • for the bootstrap, shouldn't be there an option to specify the number of bootstrapped samples? I tried putting it on and it takes ages (also including a progress bar?)
  • the information messages could be more informative by using plain English instead of the lavaan syntax names? (e.g., robust.sem)
    image

@juliuspfadt
Copy link
Contributor Author

juliuspfadt commented Sep 5, 2024

  • for the bootstrap, shouldn't be there an option to specify the number of bootstrapped samples? I tried putting it on and it takes ages (also including a progress bar?)

Taking ages can very well be. Especially if you have a model that does not fit very well. It does include a progress bar does it not? How do you not see an option for the bootstrap samples:
Screenshot 2024-09-05 at 14 54 26

  • the information messages could be more informative by using plain English instead of the lavaan syntax names? (e.g., robust.sem)

Agreed

@juliuspfadt
Copy link
Contributor Author

I am patiently waiting for your review

@juliuspfadt
Copy link
Contributor Author

Ready :)

@FBartos
Copy link
Contributor

FBartos commented Sep 24, 2024

So, I dinally managed to get this running on 19.0 release --- you were right about that.

@FBartos
Copy link
Contributor

FBartos commented Sep 24, 2024

  • there is one too many closing brackets in the end image
  • the boostrap progress bar and settings is missing for the "Model test" (feel free to make an issue for future for this)
    image

otherwise seems to be ok

@juliuspfadt
Copy link
Contributor Author

Approve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment