Question: Use this R script code to answer these 4 formulas . breast = read.csv ( file . choose ( ) , header =

Use this R script code to answer these
4
formulas.
breast
=
read.csv
(
file
.
choose
(
"
"
)
,
header
=
TRUE
)
attach
(
breast
)
model
2
=
glm
(
as
.
factor
(
BenignMalignant
)
~ClumpThickness
+
CellSizeUniformity
+
CellShapeUniformity
+
MarginalAdhesion
+
SingleEpithelialCell
+
BareNuclei
+
BlandChromatin
+
NormalNucleoli
+
Mitoses,
family
=
binomial
(
link
=
"logit"
)
)
breast$prediction
2
=
exp
(
predict
(
model
2
,
breast
)
)
/
1
+
exp
(
predict
(
model
2
,
breast
)
)
for
(
i in
1
:
6
9
9
)
{
if
(
breast$prediction
2
[
i
]
>
0
.
5
)
{
breast$prediction
2
[
i
]
=
4
}
else
(
breast$prediction
2
[
i
]
=
2
)
}
table
(
as
.
factor
(
breast$BenignMalignant
)
,
as
.
factor
(
breast$prediction
2
)
)
table
(
as
.
factor
(
breast$prediction
)
,
as
.
factor
(
breast$prediction
2
)
)
 Use this R script code to answer these 4 formulas. breast

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!