-
Notifications
You must be signed in to change notification settings - Fork 35
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
Function for comparing coefficients #24
Comments
Hi Mikko, Thanks for the suggestion! Sorry for the delay, but I have not had much time for programming in the past year (new daughter, job pressures, etc.). I would like to include this in the next version, and I think it can share a documentation page with It would help me out if you could add some roxygen2 comments to indicate which functions are imported that aren't in the
And to share the documentation page, you can use this comment before
If you are unfamiliar with roxygen2, here is a good tutorial: http://r-pkgs.had.co.nz/man.html If you need me to handle the documentation part, I don't think I would have time to do so before the next version goes to CRAN (hopefully end of April, if Yves can get lavaan out by then). If you can add this to the https://github.com/simsem/semTools/blob/master/semTools/R/compareFit.R file and create a pull request, that works too. But you can also just post the source-code file here and I can add it myself. You can also add an Thanks! |
Hi Terry, I can relate to your situation because it is quite similar to mine ;) I will try to check this over the easter weekend or the week after easter. I have experience using oxygen2 and can add documentation. I agree that the two functions should probably reside in the same file and share the documentation page. Also, I would like to refactor the code a bit because the function is very long and there is some duplicate code. Would it make sense to have one function (e.g. compareModels) that compares coefficients and indices, and then just two wrappers (compareFit and compareEstimates) that call this one function to print just the coefficients or indices depending on which function is called? Should I do this as a pull request? Mikko |
Great!
I don't think so. Then all the same work is being done, regardless of which wrapper is called. I like the 2 functions separate. But perhaps
Yes, please -- whenever it is ready. That way I can see github's automatic check for conflicts with my current version. Enjoy your holiday weekend! |
This function will be a very useful companion to May I suggest a few minor changes to Add
to capture the names of the fit objects (as in
and add them as prefixes (or suffixes). E.g.,
I tried these changes based on the version posted by @mronkko and this is the sample output:
The following changes may also help to merge parameter estimates whether the models have more than one group (e.g., the measure invariance example in
I did not post here the modified code I tired because I am not sure whether the version in the first post of this issue is the latest version. (And I am also not the author so it may not be OK for me to modify the code directly.) I look forward to seeing this function in P.S.: I am not familiar with
I tried |
semTools currently includes function compareFit for comparing fit indices between multiple models. Users may also be interested in comparing coefficients across different models. I created a function for that. Please let me know whether you think that the following would be a useful addition to the package. Parts of the code have been copied from the compareFit function and the print function of the lavaan summary method.
The text was updated successfully, but these errors were encountered: