Closed BernhardClemm closed 2 years ago
@BernhardClemm thank you for the reproducible example. We have tried it on Windows and it works but I see you are using an Apple, so we will test there next. Have you tried upgrading to the latest R version, 4.1.2? If you want to stay with 4.0 you may want to upgrade to 4.0.5.
Also, notice the second warning.
> m1 <- mix(participation_bin ~ news_u_log + u_visits_log + (1 | person_id), dt,
+ weights=c("wave_weight", "weight"),
+ family = binomial(link="logit"))
Warning messages:
1: In mix(participation_bin ~ news_u_log + u_visits_log + (1 | person_id), :
There were 5 rows with missing data. These have been removed.
2: In mix(participation_bin ~ news_u_log + u_visits_log + (1 | person_id), :
Group variances too small to estimate accurately. The estimated variance in the group level terms(s) “person_id:(Intercept)” is near zero. Very low variance suggests that the data is not hierarchical and that a model without these levels should be considered. If this removes all groups then a non-hierarchical model, such as logistic regression, should be considered.
> summary(m1)
Call:
mix(formula = participation_bin ~ news_u_log + u_visits_log +
(1 | person_id), data = dt, weights = c("wave_weight",
"weight"), family = binomial(link = "logit"))
Variance terms:
Level Group Name Variance Std. Error Std.Dev.
2 person_id (Intercept) 0.1254 0.01672 0.3542
Groups:
Level Group n size mean wgt sum wgt
2 person_id 174 0.9215 160.3
1 Obs 517 1.0000 517.0
Fixed Effects:
Estimate Std. Error t value
(Intercept) 0.68552 1.06757 0.642
news_u_log 0.09744 0.05925 1.645
u_visits_log -0.12337 0.12820 -0.962
@BernhardClemm strangely my R session became non-responsive when I just pasted in dt
under 4.0.4 on an x86_64 Apple, but when I upgraded to R 4.1.2 it worked. Can you upgrade your R and see if you still have this issue?
> version
_
platform x86_64-apple-darwin17.0
arch x86_64
os darwin17.0
system x86_64, darwin17.0
status
major 4
minor 1.2
year 2021
month 11
day 01
svn rev 81115
language R
version.string R version 4.1.2 (2021-11-01)
nickname Bird Hippie
if you do, can you please post the results of sessionInfo()
here is mine
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] WeMix_3.2.0 lme4_1.1-27.1 Matrix_1.3-4
loaded via a namespace (and not attached):
[1] gmp_0.6-2.1 Rcpp_1.0.7 compiler_4.1.2 pillar_1.6.4 nloptr_1.2.2.3 RColorBrewer_1.1-2
[7] plyr_1.8.6 tools_4.1.2 statmod_1.4.36 boot_1.3-28 lifecycle_1.0.1 tibble_3.1.6
[13] nlme_3.1-153 gtable_0.3.0 lattice_0.20-45 pkgconfig_2.0.3 NPflow_0.13.3 rlang_0.4.12
[19] Rmpfr_0.8-7 stringr_1.4.0 vctrs_0.3.8 grid_4.1.2 glue_1.5.0 ellipse_0.4.2
[25] R6_2.5.1 fansi_0.5.0 pheatmap_1.0.12 minqa_1.2.4 ggplot2_3.3.5 reshape2_1.4.4
[31] fastcluster_1.2.3 magrittr_2.0.1 scales_1.1.1 ellipsis_0.3.2 MASS_7.3-54 splines_4.1.2
[37] colorspace_2.0-2 numDeriv_2016.8-1.1 utf8_1.2.2 stringi_1.7.5 munsell_0.5.0 truncnorm_1.0-8
[43] crayon_1.4.2
Hi @pdbailey0, thanks for your help on this. I updated R to 4.1.2 but unfortunately, the problem persists - R still crashing after 3-4 minutes into running the mix
command.
sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] WeMix_3.2.0 lme4_1.1-27.1 Matrix_1.3-4
loaded via a namespace (and not attached):
[1] gmp_0.6-2.1 Rcpp_1.0.7 compiler_4.1.2 pillar_1.6.4 nloptr_1.2.2.3 RColorBrewer_1.1-2 plyr_1.8.6 tools_4.1.2
[9] statmod_1.4.36 boot_1.3-28 lifecycle_1.0.1 tibble_3.1.6 nlme_3.1-153 gtable_0.3.0 lattice_0.20-45 pkgconfig_2.0.3
[17] NPflow_0.13.3 rlang_0.4.12 Rmpfr_0.8-7 stringr_1.4.0 vctrs_0.3.8 grid_4.1.2 glue_1.5.0 ellipse_0.4.2
[25] R6_2.5.1 fansi_0.5.0 pheatmap_1.0.12 minqa_1.2.4 ggplot2_3.3.5 reshape2_1.4.4 fastcluster_1.2.3 magrittr_2.0.1
[33] scales_1.1.1 ellipsis_0.3.2 MASS_7.3-54 splines_4.1.2 colorspace_2.0-2 numDeriv_2016.8-1.1 utf8_1.2.2 stringi_1.7.5
[41] munsell_0.5.0 truncnorm_1.0-8 crayon_1.4.2
@BernhardClemm thanks for reporting back. Can you run R at the command line and share the error? So put everything in your original post in a file named, say myFile.R
file and in the Terminal app cd
to the folder with myFile.R
in it and run
R myFile.R
and then share the output in myFile.Rout
?
@pdbailey0 sorry for the late reply. Ran the above code at the command line, and this is what I get when R aborts:
*** caught illegal operation ***
address 0x113b7523b, cause 'illegal opcode'
Traceback:
1: mpfr.default(log(grd$w[i]) + agg$lli + agg$g_weight + sum(v * v), acc)
2: mpfr(log(grd$w[i]) + agg$lli + agg$g_weight + sum(v * v), acc)
3: calc.lin.lnl.quad(y = y, yhat = yyh0, level = levels, Z = Z, ZFull = ZFull, Qi = Qi, QiFull = QiFull, omega = omega, omegaFull = omegaFull, W = W, C = parC, qp = qp, top = top, verbose = verbose, acc = acc, integralMultiplierExponent = integralMultiplierExponent, integralZColumn = integralZColumn, family = family)
4: fn0(est, varFloor = -3.59)
5: mix(participation_bin ~ news_u_log + u_visits_log + (1 | person_id), dt, weights = c("wave_weight", "weight"), family = binomial(link = "logit"))
6: summary(mix(participation_bin ~ news_u_log + u_visits_log + (1 | person_id), dt, weights = c("wave_weight", "weight"), family = binomial(link = "logit")))
An irrecoverable exception occurred. R is aborting now ...
zsh: illegal hardware instruction Rscript myfile.R
(I don't see a myfile.out in the folder where myfile.R is located - would it have any other information?)
Thanks, this is what I needed. This appears to be in mpfr.default
.
We are both running the latest Rmprf, but it could be that you have an older processor and Rmpfr is using a call not available on your machine (see this SO post for an example of that).
However, I don't see anything about this on the mpfr bug site.
What machine do you have? From the "System report" under "About this Mac" I ran on a Macbook Pro 13,3 with Quad-Core Intel Core i7. I would try building mpfr from source instead of using the CRAN binary. I'm attempting this and it is difficult.
I am running it on an Apple M1 chip:
Hardware Overview:
Model Name: MacBook Air Model Identifier: MacBookAir10,1 Chip: Apple M1 Total Number of Cores: 8 (4 performance and 4 efficiency) Memory: 8 GB System Firmware Version: 6723.140.2 OS Loader Version: 6723.140.2 Serial Number (system): C02F10SYQ6LW Hardware UUID: CB8B9CA0-165D-5EE3-95BB-3CA16812EB42 Provisioning UDID: 00008103-000E40883CF2001E Activation Lock Status: Enabled
@BernhardClemm I'd try the ARM64 version of R.
Since this was a Rosetta issue in mpfr
, I'm closing this. Probably the best next step is to move to the ARM64 version or follow up with the developers of mpfr
if you are still having problems.
Sorry for never getting back. Thanks for your help in any case!
For a reproducible example, use these data:
Running a logistic model on outcome "participation_bin" causes my R to crash:
My version: