I'm trying to do a simple logistic regression model on two models. I'm using a ThreeCancers.RData that contains 3 vectors with one of them being GeneExp.
Logistic regression model done with GeneExp$Gene15 as the explanatory variable and y as the response
y such that
yi = 1 if the i-th subject has KIRC cancer and yi = 0 otherwise.
Code for y:
y = as.numeric(CancerType == 'KIRC')
My code for the logistic regression model is:
fit <- lm(log(y) ~ log(GeneExp$Gene15))
However, I keep getting this error that I don't know how to fix. Please help!!
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : **
** NA/NaN/Inf in 'y'
ps. lm works fine w/ these variables without log being added