R script lm predict output If my response is either 0 or 1, and my prediction model is as follows, are my predicted values essentially telling me the likelyhood of it being 1? I'm getting predicted values like 0.63, 0.82, 0.19, etc. So could that be interpreted as 63% likelyhood of it being 1, etc? I would like to get the likelyhood of the response to be 1 to be my resulting output.
fit <- lm(response ~ column_a + column_b, dataset, na.action=na.omit)
dataset$predicted_values <- predict(fit, dataset, type="response")

If that's not the case, how would I get such a metric? Are there alternatives for the type?
Thank you!
 A: Please note that if your response variable is binary, linear regression is NOT appropriate. You need to use logistic regression which is similar to linear regression in many ways. 
Here I created an example to show why linear regression is not a good option for binary response variable. As you mentioned, we are interested in the probability of getting 1 or 0.
#Creat a dataset
set.seed(123)
df1 <- data.frame(y = rep(0,100), x = rnorm(100, 10, 2))
df2 <- data.frame(y = rep(1,100), x = rnorm(100, 15, 1))
df <- rbind(df1,df2)

#plot data
plot(df$x,df$y)

Figure 1

You can use lm() function in R to fit linear regression to your data:
 #Linear regression model
 model1 <- lm(y ~ x, data = df)
 model1$coefficients
 (Intercept)           x 
 -1.4271695   0.1537231

So, if you want to predict the probability of x = 16 based on above formula, you get 1.0324 which is greater that 1. In the same way, if you want to predict small values, you would get values smaller than 0 (See figure 2). These predictions are not sensible, since  the true probability must fall between 0 and 1. These inconsistencies increase as data become more imbalanced and the number of outliers increase.
Now, we apply Generalized Linear Model using glm() function in R on our data:
#Logistic regression model
model2 <- glm(y ~ x, data = df, family = "binomial")
model2$coefficients
(Intercept)           x 
-36.119568    2.730215 

In logistic regression, we use the logistic function, which is defined as bellow:

and produces the S-shaped curve. p(x) is interpreted as the probability of y = 1 given specific x. In our example, beta0 = -36.119568 and beta1 = 2.730215.
Figure 2 shows the results of both linear and logistic regression.
#plot results
x_fit <- seq(min(df$x), max(df$x), length.out = 200)
y_fit <- exp(model2$coefficients[1] + model2$coefficients[2] * x_fit) / 
         (1 + exp(model2$coefficients[1] + model2$coefficients[2] * x_fit))

plot(df$x, df$y)
lines(x_fit, y_fit, type = "l", col = "blue", lwd = 2)
abline(model1, col= "red", lwd = 2)

Figure 2

As you can see, Logistic Regression enables us to model the probability of the response variable using a function that gives outputs between 0 and 1 for all values of x.
