Model averaging in oSCR

29 views
Skip to first unread message

Prashant Mahajan

unread,
Jul 16, 2025, 8:09:05 AM7/16/25
to oSCR
Hello everyone,

Is there a better way to obtain model-averaged estimates using the oSCR package? I'm currently using the ma.coef() function, but the output returns parameter names as NA, as shown below:  

Parameter Estimate Std. Error Estimate* Std. Error* RVI 1 AIC 0.17 0.19 0.14 0.19 0.81 2 <NA> -0.94 0.45 -0.29 0.47 0.31 3 NA.1 -0.22 0.19 -0.08 0.16 0.38 4 NA.2 -1.44 0.38 -0.80 0.80 0.55 5 NA.3 -0.17 0.28 -0.04 0.16 0.23 6 NA.4 0.13 0.06 0.04 0.08 0.32 7 NA.5 -3.12 0.39 -3.12 0.39 1.00 8 NA.6 -1.51 0.18 -1.51 0.18 1.00 9 NA.7 -0.15 0.07 -0.15 0.07 1.00 10 NA.8 0.59 0.08 0.57 0.10 0.98

Best Regards,
Prashant

Chris Sutherland

unread,
Jul 16, 2025, 8:33:07 AM7/16/25
to oscr_p...@googlegroups.com
Hi Prashant, 

I am not getting the same issue using the function:

library(oSCR)
data(rbs_ecography_mods)
fl <- fitList.oSCR(list(m1,m2,m3))
ms <- modSel.oSCR(fl)
ma.coef(ms)

         Parameter Estimate Std. Error Estimate* Std. Error*  RVI
1   d0.(Intercept)    -0.55       0.16     -0.55        0.16 1.00
2          p.behav     2.92       0.21      2.92        0.21 1.00
3   p0.(Intercept)    -4.34       0.22     -4.34        0.22 1.00
4     psi.constant     0.32       0.15      0.32        0.15 1.00
5  sig.(Intercept)    -0.06       0.07     -0.06        0.07 1.00
6      t.beta.jday     0.74       0.10      0.74        0.10 1.00
7     t.beta.jday2    -0.12       0.01     -0.12        0.01 1.00
8  d.beta.session2     0.13       0.17      0.11        0.17 0.86
9  d.beta.session3     0.46       0.15      0.40        0.20 0.86
10 d.beta.session4     0.23       0.18      0.20        0.18 0.86
11     p0.session2     0.02       0.17      0.00        0.00 0.02
12     p0.session3     0.22       0.15      0.00        0.01 0.02
13     p0.session4     0.12       0.18      0.00        0.01 0.02


What happens when you run this code?

Chris

--
You received this message because you are subscribed to the Google Groups "oSCR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oscr_package...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/oscr_package/57eac19f-3f04-4744-a974-f72dab35d2b2n%40googlegroups.com.

Prashant Mahajan

unread,
Jul 18, 2025, 7:03:50 PM7/18/25
to oSCR

Hi Chris,

I'm getting the same results when running the example code you shared, but not with my own data. I'm attaching my script and .RData file here in case there's something I'm missing or doing incorrectly.

Best Regards,
Prashant
-----------------------

S_2021.R
S_2021.Rdata
Message has been deleted

Chris Sutherland

unread,
Jul 18, 2025, 7:06:07 PM7/18/25
to oSCR
Hi Prashant,

I'm away for the next week and a bit, so please bear with me. I'll take a look at this when I get back to my computer.

Chris

On Sat, Jul 19, 2025, 00:04 Prashant Mahajan <prashantm...@gmail.com> wrote:
Hi Chris,

I was able to replicate the results using the code you provided, but I’m not getting the same outcome (parameter names) with my own dataset. I’ve attached my R script and .RData file, if you could please take a look and if there’s anything I might be doing incorrectly while running the models?

Best Regards,
Prashant
  

--
You received this message because you are subscribed to the Google Groups "oSCR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oscr_package...@googlegroups.com.

Daniel Linden

unread,
Jul 31, 2025, 10:56:53 AM7/31/25
to oSCR
Hi Prashant, a solution to your problem is to run the line in bold after making your fit list (before model selection and averaging):

fl <- fitList.oSCR(list(m1,m2,m3))
for (i in 1:length(fl)) {fl[[i]]$coef.mle$param <- as.factor(fl[[i]]$coef.mle$param)}
ms <- modSel.oSCR(fl)
ma.coef(ms)

We'll need to edit the code for oSCR but it is unclear why this has suddenly popped up.

Prashant Mahajan

unread,
Aug 5, 2025, 6:25:25 AM8/5/25
to oSCR
Thank you so much Daniel for the suggestion. It worked fine.

Best regards,
Prashant
Reply all
Reply to author
Forward
0 new messages