Skip to content
Prev 387298 / 398502 Next

Making model predictions

Rui

Actually yes.  I was able to work this into my shiny app this afternoon. 

Thank you

Jeff

-----Original Message-----
From: Rui Barradas <ruipbarradas at sapo.pt> 
Sent: Sunday, February 28, 2021 5:26 AM
To: reichmanj at sbcglobal.net; R-help at r-project.org
Subject: Re: [R] Making model predictions

Hello,

Are you looking for this?


newd <- data.frame(
   Class = '1st',
   Sex = 'Male',
   Age = 'Child'
)
predict(m, newdata = newd, type = 'raw')
#            No       Yes
#[1,] 0.3169345 0.6830655


With the default type = 'class' the result is

predict(m, newdata = newd)
#[1] Yes
#Levels: No Yes


Hope this helps,

Rui Barradas

?s 14:42 de 27/02/21, Jeff Reichman escreveu: