Title: | Linear and Logistic Regression-Based Reliable Change Index |
---|---|
Description: | Here we provide an implementation of the linear and logistic regression-based Reliable Change Index (RCI), to be used with lm and binomial glm model objects, respectively, following Moral et al. <https://psyarxiv.com/gq7az/>. The RCI function returns a score assumed to be approximately normally distributed, which is helpful to detect patients that may present cognitive decline. |
Authors: | Rafael de Andrade Moral [aut, cre], Unai Diaz-Orueta [aut], Javier Oltra-Cucarella [aut] |
Maintainer: | Rafael de Andrade Moral <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.1 |
Built: | 2024-12-16 06:54:26 UTC |
Source: | CRAN |
Here we provide an implementation of the linear and logistic regression-based Reliable Change Index (RCI), to be used with lm and binomial glm model objects, respectively, following Moral et al. <https://psyarxiv.com/gq7az/>. The RCI function returns a score assumed to be approximately normally distributed, which is helpful to detect patients that may present cognitive decline.
Linear and Logistic Regression-Based Reliable Change Index
Here we provide an implementation of the linear and logistic regression-based Reliable Change Index (RCI), to be used with lm and binomial glm model objects, respectively. The RCI
function returns a score assumed to be approximately normally distributed, which is helpful to detect patients that may present cognitive decline.
Rafael de Andrade Moral [aut, cre], Unai Diaz-Orueta [aut], Javier Oltra-Cucarella [aut]
Maintainer: Rafael de Andrade Moral <[email protected]>
Moral, R.A., Diaz-Orueta, U., Oltra-Cucarella, J. (preprint) Logistic versus linear regression-based Reliable Change Index: implications for clinical studies with diverse sample sizes. DOI: 10.31234/osf.io/gq7az
This function calculates the RCI for lm
and binomial glm
objects.
RCI(model)
RCI(model)
model |
An |
This function takes a fitted model object as input and computes either the linear (for lm
objects) or logistic (for binomial glm
) regression-based reliable change index for each observation.
The function returns a numeric vector.
Rafael A. Moral, Unai Diaz-Orueta and Javier Oltra-Cucarella.
Moral, R.A., Diaz-Orueta, U., Oltra-Cucarella, J. (preprint) Logistic versus linear regression-based Reliable Change Index: implications for clinical studies with diverse sample sizes. DOI: 10.31234/osf.io/gq7az
data(RCI_sample_data) linear_fit <- lm(score ~ baseline + age + gender + education, data = RCI_sample_data) logistic_fit <- glm(cbind(score, 15 - score) ~ baseline + age + gender + education, family = binomial, data = RCI_sample_data) linear_RCI <- RCI(linear_fit) logistic_RCI <- RCI(logistic_fit) plot(linear_RCI, logistic_RCI)
data(RCI_sample_data) linear_fit <- lm(score ~ baseline + age + gender + education, data = RCI_sample_data) logistic_fit <- glm(cbind(score, 15 - score) ~ baseline + age + gender + education, family = binomial, data = RCI_sample_data) linear_RCI <- RCI(linear_fit) logistic_RCI <- RCI(logistic_fit) plot(linear_RCI, logistic_RCI)
This function calculates the RCI for a new patient based on a fitted lm
or binomial glm
model object.
RCI_newpatient(model, new)
RCI_newpatient(model, new)
model |
An |
new |
A data frame with data for the new patient. |
This function takes a fitted model object and new patient data as input and computes either the linear (for lm
objects) or logistic (for binomial glm
) regression-based reliable change index. The names of the variables in the new patient data have to match the names of the predictors and response variable for the fitted model.
The function returns a numeric vector.
Rafael A. Moral, Unai Diaz-Orueta and Javier Oltra-Cucarella.
Moral, R.A., Diaz-Orueta, U., Oltra-Cucarella, J. (preprint) Logistic versus linear regression-based Reliable Change Index: implications for clinical studies with diverse sample sizes. DOI: 10.31234/osf.io/gq7az
data(RCI_sample_data) ## fitting models to sample linear_fit <- lm(score ~ baseline + age + gender + education, data = RCI_sample_data) logistic_fit <- glm(cbind(score, 15 - score) ~ baseline + age + gender + education, family = binomial, data = RCI_sample_data) ## new patient data new_patient <- data.frame("age" = 68, "gender" = "male", "score" = 9, "baseline" = 11, "education" = 12) ## calculating RCI for new patient without refitting model RCI_newpatient(model = linear_fit, new = new_patient) RCI_newpatient(model = logistic_fit, new = new_patient)
data(RCI_sample_data) ## fitting models to sample linear_fit <- lm(score ~ baseline + age + gender + education, data = RCI_sample_data) logistic_fit <- glm(cbind(score, 15 - score) ~ baseline + age + gender + education, family = binomial, data = RCI_sample_data) ## new patient data new_patient <- data.frame("age" = 68, "gender" = "male", "score" = 9, "baseline" = 11, "education" = 12) ## calculating RCI for new patient without refitting model RCI_newpatient(model = linear_fit, new = new_patient) RCI_newpatient(model = logistic_fit, new = new_patient)
This dataset is a simulated sample of 100 patients from a study on cognitive decline.
data("RCI_sample_data")
data("RCI_sample_data")
A data frame with 100 observations on the following 5 variables:
age
The patient's age.
gender
A factor with two levels: "male" or "female".
score
The score obtained after 6 months.
baseline
The score obtained at the start of the study.
education
Number of years of education.
data(RCI_sample_data)
data(RCI_sample_data)