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

julia_eval scrambling parameter order when returning :glmerMod #236

Open
coverton-usgs opened this issue Sep 22, 2024 · 1 comment
Open

Comments

@coverton-usgs
Copy link

When returning a GeneralizedLinearMixedModel result using julia_eval I get estimates in the subsequently saved .rds that are out of order with the labels in julia.

The data I am running is quite large and not easily shared. So I apologies for an incomplete example. The code:

julia_assign("m0form", formula(case ~ 0 + Analysisclass + (1|cropyear/individual_local_identifier)))
julia_command(sprintf('Jmodel = fit(GeneralizedLinearMixedModel, m0form, data, Bernoulli(), wts=float.(data.weights), contrasts= Dict(:Analysisclass => DummyCoding(base="aRice_Wet_day")))'))

produces:
image

But when I save it into R using:

juliamodel<- julia_eval("robject(:glmerMod, Tuple([Jmodel, data]));",need_return ="R") 

I get:
image

That is a pretty serious discrepancy! Any recommendation on how to prevent this or identify the correct parameter order from the rds alone?

I ran this code in a loop across different datasets and saving only the .rds and not retaining a log to see the original Julia output.

@coverton-usgs
Copy link
Author

I also just noticed that the SE estimates are close but not identical between the objects as well

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

No branches or pull requests

1 participant