Comments (4)
Thanks @danielinteractive. I've included the output above. Even after installing the latest version of mmrm, I'm still getting the same output as before.
from mmrm.
Thanks @sstats2024 , can you please include the output you get?
from mmrm.
Also please try to install the latest CRAN release and see if the problem persists
from mmrm.
Hi again @sstats2024 ,
so I ran this on my Macbook, and also get slightly different coefficient estimates each time:
> coef(mmrmfit1)
eye_visitleft_Week0 eye_visitleft_Week4 eye_visitleft_Week8 eye_visitright_Week0
27.2299828 29.2062931 35.7662590 26.6797737
eye_visitright_Week4 eye_visitright_Week8 age
33.3781034 36.9494047 -0.3037041
> coef(mmrmfit2)
age eye_visitleft_Week0 eye_visitleft_Week4 eye_visitleft_Week8
-0.3037215 27.2307519 29.2070622 35.7670281
eye_visitright_Week0 eye_visitright_Week4 eye_visitright_Week8
26.6805428 33.3788725 36.9501738
> c1 <- coef(mmrmfit1)
> c2 <- coef(mmrmfit2)
> setequal(names(c1), names(c2))
[1] TRUE
> c1 - c2[names(c1)]
eye_visitleft_Week0 eye_visitleft_Week4 eye_visitleft_Week8 eye_visitright_Week0
-7.691045e-04 -7.691045e-04 -7.691045e-04 -7.691045e-04
eye_visitright_Week4 eye_visitright_Week8 age
-7.691045e-04 -7.691045e-04 1.736128e-05
> diff_coefs <- c1 - c2[names(c1)]
> diff_coefs
eye_visitleft_Week0 eye_visitleft_Week4 eye_visitleft_Week8 eye_visitright_Week0
-7.691045e-04 -7.691045e-04 -7.691045e-04 -7.691045e-04
eye_visitright_Week4 eye_visitright_Week8 age
-7.691045e-04 -7.691045e-04 1.736128e-05
> rel_diff_coefs <- abs(diff_coefs / c1)
> rel_diff_coefs
eye_visitleft_Week0 eye_visitleft_Week4 eye_visitleft_Week8 eye_visitright_Week0
2.824477e-05 2.633352e-05 2.150363e-05 2.882725e-05
eye_visitright_Week4 eye_visitright_Week8 age
2.304219e-05 2.081507e-05 5.716510e-05
> all(rel_diff_coefs < 1e-3)
[1] TRUE
However, this is completely fine, as both the absolute differences as well as the relative differences are very small. Since we use floating point calculations in the computer, the ordering of the design matrix columns, induced here by the ordering of the covariates in the formula, will slightly influence the results. But these differences don't matter in practice.
You will also see a similar behavior with other modeling packages or methodologies.
If you would like to avoid this, you would have to sort the covariates yourself before putting them in the formula e.g.
Does this solve your question?
from mmrm.
Related Issues (20)
- mmrm bioconductor dependancy HOT 4
- test for `is_using_clang` needs to be skipped on old R versions
- fitted values in mmrm HOT 8
- URGENT! Failed CRAN Checks: 2024-01-28
- L-BFGS-B divergence however error code is not correct HOT 2
- Need to document `VISITN` and `VISITN2` in `fev_data`
- Type III tests fail for character covariates
- avoid CRAN warning
- URGENT! Failed CRAN Checks: 2024-03-10 HOT 1
- [Question] Random intercept model HOT 6
- support for `{marginaleffects}`
- predict() does not work when variables are transformed within formula HOT 2
- fix note
- Add positive definiteness check of `theta_vcov` to `h_mmrm_tmb_check_conv()`
- Change Daniel's email address
- LS estimates using spatial covariance HOT 3
- Add an application vignette HOT 5
- Please help on the Error message below HOT 1
- emmeans result not correct when log-transformed covariate is used HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmrm.