Hello! I am currently working on logistic regressions (within the EdSurvey package) and before doing so would like to check that all requirements are given. To check for Linearity between the predictors I would like to use the Box-Tidwell-Approach, though I am not sure whether to use the variables directly or their log (as suggested by the texts I have read about this). I am also not sure what exactly is meant by log or how to easily calculate it, if I do need it.
When trying following code, I receive errors such as that I cannot use this with factor variables and variables of different length. Since I would have to do this many times for different data, I am looking for a solution with minimum workload to check for Linearity.
> # b) Check for Linearity > # via Box-Tidwell approach: > > data_omitNAs <- data[complete.cases(data),] > > boxTidwell(LitLevel ~ ageg10lfs + gender_r + nativelang + readytolearn_wle_ca + pared + edlevel3 + j_q02a + j_q03a, > data=data, > subset(data, (ageg10lfs >=1 & ageg10lfs <=5) & (gender_r ==1 | gender_r == 2) & nativelang ==1 & (readytolearn_wle_ca >=1 & readytolearn_wle_ca <=5) & (pared >=1 & pared <=3) & (edlevel3 >=1 & edlevel3 <=3) & (j_q02a ==1 | j_q02a ==2) & (j_q03a ==1 | j_q03a ==2)), > na.action=na.omit, > verbose=FALSE, > tol=0.001, > max.iter=25) > > # alternative: visual check (what/how?)