smof-package {smof}R Documentation

Scoring Methodology for Ordered Factors

Description

Starting from a given object representing a fitted model (within a certain set of model classes) whose linear predictor includes some ordered factor(s) among the explanatory variables, a new model is constructed and fitted where each named factor is replaced by a single numeric score, suitably chosen so that the new variable produces a fit comparable with the standard methodology based on a set of polynomial contrasts.

Details

The DESCRIPTION file:

Package: smof
Type: Package
Title: Scoring Methodology for Ordered Factors
Version: 1.2.0
Date: 2024-09-17
Authors@R: person(given = "Adelchi", family = "Azzalini", email = "adelchi.azzalini@unipd.it", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7583-1269"))
Maintainer: Adelchi Azzalini <adelchi.azzalini@unipd.it>
Depends: R (>= 4.0.0)
Imports: stats, methods
Suggests: ggplot2, survival
ByteCompile: yes
NeedsCompilation: no
Description: Starting from a given object representing a fitted model (within a certain set of model classes) whose linear predictor includes some ordered factor(s) among the explanatory variables, a new model is constructed and fitted where each named factor is replaced by a single numeric score, suitably chosen so that the new variable produces a fit comparable with the standard methodology based on a set of polynomial contrasts. Two variants of the present approach have been developed, one in each of the next references: Azzalini (2023) <doi:10.1002/sta4.624>, (2024) <doi:10.48550/arXiv.2406.15933>.
License: GPL-2 | GPL-3
Encoding: UTF-8
Author: Adelchi Azzalini [aut, cre] (<https://orcid.org/0000-0002-7583-1269>)

Index of help topics:

print.smof              Methods for 'smof' objects
smof                    Scoring Methodology for Ordered Factors
smof-package            Scoring Methodology for Ordered Factors
smof_refit              Re-fitting an existing 'smof' model for
                        improved optimization

Author(s)

Author: Adelchi Azzalini [aut, cre] (<https://orcid.org/0000-0002-7583-1269>) Maintainer: Adelchi Azzalini <adelchi.azzalini@unipd.it>

References

Azzalini, A. (2023). On the use of ordered factors as explanatory variables. Stat 12, e624. doi:10.1002/sta4.624

Examples

library(datasets)
data(esoph)
contrasts(esoph$agegp, 2) <- contr.poly(6) # optional
contrasts(esoph$tobgp, 1) <- contr.poly(4) # optional
obj1 <- glm(cbind(ncases, ncontrols) ~ agegp + tobgp + alcgp, family=binomial(), data=esoph)        
out0 <- smof(obj1, esoph, "alcgp")
print(summary(out0$object)) 

[Package smof version 1.2.0 Index]