Basically, on Rstudio I'm trying to perform a binary logistic regression. I've downloaded the data and recoded the factors to categorical variables however when I perform the contrasts with the code contrasts() it comes out as: contrasts(dogs$dog)
[,1]
no 1
yes -1
which isn't right as it should be 0,1. Hence when I perform the binary logistic regression I get the error: Error in eval(family$initialize) : y values must be 0 <= y <= 1.
Can someone help me fix this, please?
THe code ive downloaded
library(psyntur)
library(tidyverse)
library(modelr)
dogs <- read.csv("dogs.csv")
dogs
str(dogs)
dogs$dog<-as.factor(dogs$dog)
str(dogs)
contrasts(dogs$dog)
m2 <- glm(like_cats ~ dog, data = dogs, family = binomial)
summary(m1)```