How to calculate exponential in R

r
data_science

#1

Hi All,
I am going through logistic regression; I came across this expression

                                     P = 1/1+ e^-(a+bx)

If a and b are known,then how to calculate “P” in R


#2

You can use exp()

Example: exp(1.563)=4.773119

Probability = 4.773119 / (1 + 4.773119) = 0.8267


#3

You can exponential function which comes with base R.

Exp()