Logistic Regression

Discuss statistics related things
Post Reply
FurlanLeo
Posts: 1
Joined: Wed Aug 24, 2022 2:32 pm

Logistic Regression

Post by FurlanLeo »

Does anyone know how to check the "Linearity Assumption" of a Logistic Regression Model in Jamovi?
What about useful R codes (for Logistic Regression) to be used via RjEditor?
Thanks!
BeginnerA
Posts: 15
Joined: Wed Aug 17, 2022 7:40 pm

Re: Logistic Regression

Post by BeginnerA »

Based on this page,
https://search.r-project.org/CRAN/refma ... egBin.html
I think it may be something like this code:

data('birthwt', package='MASS')

dat <- data.frame(
low = factor(birthwt$low),
age = birthwt$age,
bwt = birthwt$bwt)

jmv::logRegBin (data = dat, dep = low,
covs = vars(age, bwt),
blocks = list(list("age", "bwt")),
refLevels = list(list(var="low", ref="0")),
boxTidwell =T)
summary(data)

However, I tried it and this was the output:
Image

(A table was designed for the test, but no output)
Maybe one of the makers can tell if the code needs more input.
Best regards
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: Logistic Regression

Post by MAgojam »

BeginnerA wrote:(A table was designed for the test, but no output)
Hey,
if you take a look at the binary logistic regression, directly in jamovi, passing from the Analyses->Regression->2 Otcomes ribbon you will find that in "Assumption Checks" there is only the checkbox for statistical collinearity and there is no checkbox for get the Box-Tidwell test.
Your example Rj script worked without errors, showing an empty table because the test is not yet available, but there is an output placeholder for it to indicate that it probably will be in a future version.

You might want to try this handful of code in Rj?

Code: Select all

data <- MASS::'birthwt'
jmv::logRegBin (data = data, 
                dep = low,
                covs = vars(age, bwt),
                blocks = list(list("age", "bwt")),
                refLevels = list(list(var="low", ref="0")))
car::boxTidwell(low~age+bwt, data=data)
Cheers,
Maurizio
BeginnerA
Posts: 15
Joined: Wed Aug 17, 2022 7:40 pm

Re: Logistic Regression

Post by BeginnerA »

Thank you

I tried it and here is the output:

Output:

Code: Select all

MLE of lambda Score Statistic (z) Pr(>|z|)    
age        -15.61                 1.2      0.2    
bwt          0.49                 3.4    6e-04 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

iterations =  22
Post Reply