FAQ
Hello,

I'm looking for a package or function, which calculate OR/HR from spline
model regression. for example in SAS it exist some MACRO helping to do that
easiely.

i had make some research on the forum here and on the web but without any
succes.

Takiy

--
Takiy BERRANDOU
0618916037
takiyeddine at gmail.com

[[alternative HTML version deleted]]

## Search Discussions

•  at Jun 15, 2016 at 3:56 pm ⇧

On Jun 14, 2016, at 7:43 AM, takiy berrandou wrote:

Hello,

I'm looking for a package or function, which calculate OR/HR from spline
model regression. for example in SAS it exist some MACRO helping to do that
easiely.

i had make some research on the forum here and on the web but without any
succes.

It's not yet clear what you want to do. Odds ratios are easily calculated from logistic regression models (typically constructed with the glm function the stats package) and hazard ratios are easily calculated from survival models (typically constructed with survreg or coxph in the survival package). All those functions accept spline terms in their formula versions. There are many worked examples that could be found with google searching since google now properly interprets the letter "r" as referring to the computer language. You can get a more focussed search using rseek.com.

[[alternative HTML version deleted]]

You should read the posting guide. Rhelp is a plain text mailing list.

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA
•  at Jun 15, 2016 at 4:12 pm ⇧
Hello,
thank you for the answer. it's true i was'nt clear enough.
the problem with glm()/gam or coxph() when the spline terms are used
(specialy spline of 3rd degree) the calculated coefficients for the spline
terms are difficult to interpret. for example for spline of degree=3 and 3
knots, there are 7 beta's calculated, and to represent the result clearly
we need to calculate OR/HR against a reference. just making exp(beta)
does'nt have a propre meaning.
On SAS there are some MACRO's like %regspline which help to make some
calcul to figure out the OR's.

2016-06-15 17:56 GMT+02:00 David Winsemius <dwinsemius@comcast.net>:

On Jun 14, 2016, at 7:43 AM, takiy berrandou wrote:

Hello,

I'm looking for a package or function, which calculate OR/HR from spline
model regression. for example in SAS it exist some MACRO helping to do that
easiely.

i had make some research on the forum here and on the web but without any
succes.
It's not yet clear what you want to do. Odds ratios are easily calculated
from logistic regression models (typically constructed with the glm
function the stats package) and hazard ratios are easily calculated from
survival models (typically constructed with survreg or coxph in the
survival package). All those functions accept spline terms in their formula
versions. There are many worked examples that could be found with google
searching since google now properly interprets the letter "r" as referring
to the computer language. You can get a more focussed search using
rseek.com.

[[alternative HTML version deleted]]
You should read the posting guide. Rhelp is a plain text mailing list.
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
David Winsemius
Alameda, CA, USA

--
Takiy BERRANDOU
0618916037
takiyeddine at gmail.com

[[alternative HTML version deleted]]
•  at Jun 15, 2016 at 6:37 pm ⇧

On Jun 15, 2016, at 9:12 AM, takiy berrandou wrote:

Hello,
thank you for the answer. it's true i was'nt clear enough.
the problem with glm()/gam or coxph() when the spline terms are used (specialy spline of 3rd degree) the calculated coefficients for the spline terms are difficult to interpret.

Not just difficult, but also generally unwise to attempt interpretation of individual spline coefficients.

for example for spline of degree=3 and 3 knots, there are 7 beta's calculated, and to represent the result clearly we need to calculate OR/HR against a reference.

Natural splines are third degree, although generally the number of knots is 1 less than the degree of the polynomial.

just making exp(beta) does'nt have a propre meaning.
On SAS there are some MACRO's like %regspline which help to make some calcul to figure out the OR's.

The predict.* functions will generally handle that difficulty naturally. Each of hte regression functions will have a specific `predict` method for the class of model object. You simply provide the values for the covariates in a dataframe and a prediction for for total of associated terms will be returned. See:

?predict.glm

Std errors are generally available if the proper parameters are offered to the function. This procedure should be exemplified in the help documents and vignettes of the packages with whatever regression function you anticipate using. On the Rhelp mailing list you are requested to present questions with sufficient code to support a coding response.

--
David

2016-06-15 17:56 GMT+02:00 David Winsemius <dwinsemius@comcast.net>:
On Jun 14, 2016, at 7:43 AM, takiy berrandou wrote:

Hello,

I'm looking for a package or function, which calculate OR/HR from spline
model regression. for example in SAS it exist some MACRO helping to do that
easiely.

i had make some research on the forum here and on the web but without any
succes.
It's not yet clear what you want to do. Odds ratios are easily calculated from logistic regression models (typically constructed with the glm function the stats package) and hazard ratios are easily calculated from survival models (typically constructed with survreg or coxph in the survival package). All those functions accept spline terms in their formula versions. There are many worked examples that could be found with google searching since google now properly interprets the letter "r" as referring to the computer language. You can get a more focussed search using rseek.com.

[[alternative HTML version deleted]]
You should read the posting guide. Rhelp is a plain text mailing list.
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
and provide commented, minimal, self-contained, reproducible code.
David Winsemius
Alameda, CA, USA

--
Takiy BERRANDOU
0618916037
takiyeddine at gmail.com

David Winsemius
Alameda, CA, USA
•  at Jun 15, 2016 at 4:08 pm ⇧

Em Ter 14 jun. 2016, ?s 11:43, takiy berrandou escreveu:
Hello,

I'm looking for a package or function, which calculate OR/HR from spline
model regression. for example in SAS it exist some MACRO helping to do
that
easiely.

i had make some research on the forum here and on the web but without any
succes.

One, there are functions/packages to calculate OR/HR.
Two, there are functions/packages to use splines as predictors, instead
of the usual linear effect.

As David said, "odds ration in R" and so on is a great way to find what
you want.

Att,

Leonardo Ferreira Fontenelle, MD, MPH

PhD candidate in epidemiology, Federal University of Pelotas
Professor of medicine, Vila Velha University
Legislative consultant in health, Municipal Chamber of Vit?ria.

## Related Discussions

Discussion Overview
 group r-help categories r posted Jun 14, '16 at 2:43p active Jun 15, '16 at 6:37p posts 5 users 3 website r-project.org irc #r

### 3 users in discussion

Content

People

Support

Translate

site design / logo © 2018 Grokbase