biometrician / abe

An R package for Augmented Backward Elimination
GNU General Public License v3.0
3 stars 0 forks source link

#37: abe.resampling saved output #37

Closed biometrician closed 1 year ago

biometrician commented 1 year ago

I am not completely inside the code at the moment, so maybe this is intentionally.

I have this object: BE_stability <- abe.resampling(global_model, data = bodyfat, include = c("abdomen", "height"), criterion ="AIC", tau = Inf, type.resampling = "Wallisch2021", prop.sampling = 0.5, num.resamples = 100)

When I look at the object, I get this

names(BE_stability) [1] "models" "models.wallisch" "model.parameters" "alpha" "tau" "num.boot" "criterion" "all.vars"
[9] "fit.or" "misc" "id" "call"

names(BE_stability$misc) [1] "tau" "criterion" "alpha" "type.boot" "prop.sampling"

So under "misc" we have "tau", "criterion" and "alpha", but this is also included outside "misc".

Couldn't we just delete it outside of "misc", or am I missing something?

rokblagus commented 1 year ago

The plot, summary and print functions depend on the misc having exactly these values, so we cannot simply omit its elements, unless we are willing to make changes to all the other functions.

biometrician commented 1 year ago

I assumed that the input from $misc is used in the other functions.

My question is, do we need the same information outside of $misc, as well? Or are there cases, where these parameters ("tau", "alpha" and "criterion" are not the same inside and outside of $misc?)

If no, I would suggest to delete these three outside of $misc. If we agree, Gregor could check if they are used anywhere else in the code.

rokblagus commented 1 year ago

I checked and currently, it is a huge mess, since in some functions I was using misc (e.g. in print) and in others directly alpha or tau. So this would have to be changed consistently in all the functions if we decide to change the output of abe.resampling.

biometrician commented 1 year ago

I will ask Gregor to look through the code and make this consistent. Rok, do you have a preference to the parameters being inside or outside of $misc?

rokblagus commented 1 year ago

I don't know, maybe everything in misc? If Gregor has other things, then I can also do this, Gregor?

biometrician commented 1 year ago

I just talked with Gregor. He can take care of it. So metaparameters are in $misc. (I also like it, as it is somehow sorted.)

gregorsteiner commented 1 year ago

So alpha and tau are now only returned in the misc section. In the rest of the code, I replaced all calls to object$alpha/object$tau with object$misc$alpha/object$misc$tau. I hope I did not miss anything

rokblagus commented 1 year ago

Thanx, but to make this consistent, we should then also put num.boot and criterion to misc and make appropriate changes to plot, print, summary functions.