Question: breast = read. file. choose ( ) , header = TRUE ) attach ( breast ) model 2 = glm ( as . factor (

breast=read. file. choose (), header=TRUE)
attach(breast)
model2=glm(as . factor(BenignMalignant) ClumpThickness+CellSizeUniformity+CellShapeUniformity
+MarginalAdhesion+SingleEpithelialCell+BareNuclei+
BlandChromatin+NormalNucleoli+Mitoses,
family=binomial(link="logit"))
breast$prediction2=exp(predict(model2,breast))/1+exp(predict(model2,breast))
for(i in 1:699){
if(breast$prediction2[i]>0.5
breast$prediction2[i]=4
}
else(breast$prediction2[i]=2)
}
table(as.factor(breast$BenignMalignant), as.factor(breast$prediction))
table(as.factor(breast$BenignMalignant), as . factor(breast$prediction2))
table(as. factor(breast$prediction), as . factor(breast$prediction2))
Your goal is to write a script in R that will take the 2x2 table in R for your logistic regression results in HW 2 and use it to derive those measurements.
 breast=read. file. choose (), header=TRUE) attach(breast) model2=glm(as . factor(BenignMalignant) ClumpThickness+CellSizeUniformity+CellShapeUniformity +MarginalAdhesion+SingleEpithelialCell+BareNuclei+

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!