Monday, September 8, 2025

Parametric bootsrap of a mixed model

 Lately I have been tackling a problem about estimating precision and trueness of dental measurements. I know that a mixed effects model is a best way to reveal these estimates, so I go that way. 

I built some models with lm4::lmer and nlme::lme. Since lmer doesn't enable heterogenity in variances, I mainly focused on lme. I hadn't thought other packages like glmmTMB or similar although they might have best options. Since lme couldn't calculate 95% CIs, I wrote a simple script doing first nonparametric bootstrap, then parametric bootstrap. 

 I extracted variance components from the main by simulation, and calculated CIs for precision and trueness. Mixed models did a big job. 

But, after all those serious work for simulations, I discovered that parameters package have this ability builtin its functions like simulate_model and model_parameters. 

model_paramaters  didn't work smoothly but simulate_model did the same job what my code of 100+ lines and many hours of work did immediately. I was surprised by the magical ease those functions supplied. 

 

Thursday, August 7, 2025

xfun::attr() error in R

 I was getting errors in my pdf output files after rendering them.

## Warning in attr(.knitEnv$meta, "knit_meta_id"): 'xfun::attr()' is deprecated. ## Use 'xfun::attr2()' instead. ## See help("Deprecated")

This should be a problem with xfun/knitr packages of R. I tried to update them with no help. None of  the commands

 warning=FALSE

 knitr::opts_chunk$set(warning = FALSE)

options(warn = -1) 

would help neither. I then asked a solution to ChatGPT and it proposed the following hacky way which worked like a charm

sink("tmp.txt")
suppressWarnings(rmarkdown::render("path/to/yourfile.rmd"))
sink()

 

Wednesday, August 6, 2025

Julia error 'OPENSSL_3.3.0' not found

 On my Fedora 42 desktop I was getting errors like 

julia> import Pluto
ERROR: InitError: could not load library "/home/user/.julia/artifacts/1c2814ca8577e0356a6ecf8447364c19e97b86a8/lib/libssl.so"
/lib64/libcrypto.so.3: version `OPENSSL_3.3.0' not found (required by /home/user/.julia/artifacts/1c2814ca8577e0356a6ecf8447364c19e97b86a8/lib/libssl.so)
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/JLLWrappers/m2Pjh/src/products/library_generators.jl:63 [inlined]
 [2] __init__()
   @ OpenSSL_jll ~/.julia/packages/OpenSSL_jll/2yAM9/src/wrappers/x86_64-linux-gnu.jl:16
during initialization of module OpenSSL_jll

when I try to start Pluto from within julia. This error is somewhat related to version of the openssl libraries installed on my computer. I say so, because on my laptop I have a similar installation, but no such errors (may be due to some libraries lacking on my laptop). 

Anyway, after some search (not search anymore of course, chatting), I installed OpenSSL 3.5 library locally on my desktop and succeeded to link it my julia install. I tried OpenSSL versions 3.3 and 3.4 without success. Lastly version 3.5 did link to julia with some preloading/pointing like 

alias julia_local='env LD_PRELOAD=$HOME/.openssl-3.3/lib64/libcrypto.so:$HOME/.openssl-3.3/lib64/libssl.so LD_LIBRARY_PATH=$HOME/.openssl-3.3/lib64:$LD_LIBRARY_PATH julia'

 I didn't make a system-wide install of OpenSSL 3.5 not to poison the system, and couldn't upgrade to that version using dnf neither. 

This was a good hack. Happy now.
 

Wednesday, May 28, 2025

Fedora Rstudio with Electron

 Some time has passed since RStudio's transition to Electron. I use Rstudio almost daily on Fedora. It became not as stable as it was before this transition to Electron. RStudio can became unstable especially on an external screen on my laptop and together with issues from Libreoffice. 

Tuesday, November 5, 2024

Fedora 41 Rstudio change

 After upgrading to Fedora 41, I was surprised that RStudio has been deleted. It was  RStudio's transition to Electron from Qt which made Fedora developers exclude RStudio from official repos. So from now on one needs to install RStduio from copr repo maintained by iucar at this address.

Saturday, April 27, 2024

Fedora 40 RStudio startup error

 After upgrading my laptop to Fedora 40, I started RStudio and tried to install an R package. The install was failed with an error message saying

libicui18n.so.73: cannot open shared object file: No such file or directory

After doing a quick search, I thought this is a simple lacking or unlinking issue and thought creating a symbolic link will solve. I tried to understand what libicu packages were installed in my Fedora laptop. There seemed a libicu package installed. 

After some more search on my computer, I realised libicu73 package is a different package than that libicu installed on my laptop. Installing libicu73, finally solved the error I was getting.

Thursday, December 21, 2023

Camel shadow of a boxplot

Behold, from this moment onward, I shalt call camel shadow of the boxplot as its corresponding histogram.



Tuesday, August 9, 2022

RStudio knit to pdf option disappearance

 Oh my goodness. I am totally surprised when I learned how this problem that was making me feel drowned (exaggeration, of course) since yesterday has a simple solution. Actually I was trying to solve this problem by trying to convert .rmd files to .md and then to .pdf.(ie, knitting to pdf manually). I was getting erroneous outputs for some reasons still I lack to understand. 

Then I selected to change my approach to the problem and make a naive search which looks for that lacking "Knit to pdf" menu option. And the first link I found after my web engine search worked like a charm.

I learned that all I needed to do was to indent pdf_document and similar html_document commands after output: declaration. And a magic happened, knit to pdf menu option appeared. Of course, I have had a tex distribution installed on my computer beforehand.

I am now happy that my beloved pdf documents are knitted as was expected.

Tuesday, June 16, 2020

RStudio on Fedora

Fedora has 3 different RStudio packages on his repo. One is a base package named rstudio. Second is what you looking for rstudio-desktop and the last is a web based RStudio rstudio-server. Here is a list that comes
$sudo dnf search rstudio
Last metadata expiration check: 0:24:10 ago on Tue 16 Jun 2020 01:26:32 PM +03.
=========================================================== Name & Summary Matched: rstudio ============================================================
rstudio.x86_64 : RStudio base package
R-rstudioapi.noarch : Safely Access the RStudio API
rstudio-server.x86_64 : Access RStudio via a web browser
================================================================ Name Matched: rstudio =================================================================
rstudio-desktop.x86_64 : Integrated development environment for the R programming language

Sunday, May 10, 2020

MethComp package on Fedora

Recently I needed to install MethComp package on my Fedora desktop. After shooting an install.packages command it complained about a nonzero exit status saying that "ERROR: dependency ‘rjags’ is not available for package ‘MethComp’".
I urged for rjags package in Fedora repos, and couldn't find one. Therefore it was the time to make my hands dirty. rjags has a sourceforge page from which I downloaded version 4.3.0 tarball and installed it. Now it was to install rjags package which is a dependency to MethComp. This took some time to understand my new problem which is the error when I try install.packages("rjags"). Now R was complaining that "pkg-config file for jags 4 unavailable, Consider adding the directory containing `jags.pc` to the PKG_CONFIG_PATH environment variable".
After some search I found out that the jags.pc file was under the folder "/usr/local/lib/pkgconfig/", but I didn't know how to show this file to pkg-config from within R. I also recognised that some other .pc files are located in the folder "/usr/lib64/pkgconfig" on my system. So I took a shortcut and copied jags.pc file into this default folder of pkconfig. Lastly, with a command like
install.packages("rjags",configure.args="--enable-rpath")
I was able to install rjags into my system and hence MethComp.

Wednesday, February 14, 2018

SAS Proc Glimmix does everything!

Yes, it is a very unifying procedure of many different analyses (hence the name).
It can handle all the models included in Generalized Linear Mixed Models. That means all statistical analyses appeared in many elementary textbooks are supported.
It is a fantastic procedure that I became to use everyday. Together with powerful LSMESTIMATE statement it is a real giant.

An update: I was looking for calculating odds ratios in a logistic regression model where an interaction term is included. Wow, GLIMMIX has an option oddsratio in a lsmeans statement (possibly in lsmestimate too) which does the job perfectly. With slicediff, ilink and cl options, that was just what I was looking for. Awesome. GLIMMIX will be my first choice of procedures from now on.

Wednesday, July 12, 2017

Ordinal logistic regression traps

I have seen this post and that post about ordinal regression. It is strange to learn that SPSS and Stata uses a different modeling approach than SAS and Minitab. Also the SAS way explained in the second post is very important to remember when doing ordinal regressions with SAS.

Wednesday, February 15, 2017