ICTatRTI / PersonAlytics

PersonAlytics: Analytics for single-case and small N intensive longitudinal designs, idiographic clinical trials (ICT), and interrupted time series.
3 stars 2 forks source link

Add logistic regression example to documentation #35

Open stueller opened 1 year ago

stueller commented 1 year ago

library(PersonAlytics)

linear example

t0 <- PersonAlytic(output = 'Test0' , data = OvaryICT , ids = "Mare" , dvs = "follicles" , phase = "Phase" , time = "Time" , package = "gamlss" , autoSelect = list()) summary(t0)

logistic example

OvaryICT$follicles_binary <- as.numeric(cut(OvaryICT$follicles, c(-Inf, median(OvaryICT$follicles), Inf))) OvaryICT$follicles_binary <- OvaryICT$follicles_binary - 1 # must be 0,1 table(OvaryICT$follicles_binary) t0b <- PersonAlytic(output = 'Test0' , data = OvaryICT , ids = "Mare" , dvs = "follicles_binary" , phase = "Phase" , time = "Time" , package = "gamlss" , family = BI(), autoSelect = list()) summary(t0b)