monica | R Documentation |
The monica
data frame has 6357 rows and 12 columns. The
dataset mifem
(1295 rows) is the subset that has data
for females.
data(monica)
data(mifem)
Columns are:
mortality outcome, a factor with levels live
,
dead
age at onset
m = male, f = female
y = hospitalized, n = not hospitalized
year of onset
previous myocardial infarction event, a
factor with levels y
, n
, nk
not known
smoking status, a factor with levels c
current, x
ex-smoker, n
non-smoker, nk
not known
a factor with levels y
, n
, nk
not
known
high blood pressure, a factor with levels
y
, n
, nk
not known
high cholesterol, a factor with levels
y
, n
nk
not known
a factor with levels y
,
n
, nk
not known
a factor with levels
y
, n
, nk
not known
Newcastle (Australia) centre of the Monica project; see the web site http://www.ktl.fi/monica
print("CART - Example 10.7")
summary(monica)
pause()
library(rpart)
monica.rpart <- rpart(outcome ~ ., data = monica, cp = 0.0025)
plotcp(monica.rpart)
printcp(monica.rpart)
pause()
monicab.rpart <- prune(monica.rpart, cp=0.006)
print(monicab.rpart)
summary(mifem)
pause()
mifem.rpart <- rpart(outcome ~ ., data = mifem, cp = 0.0025)
plotcp(mifem.rpart)
printcp(mifem.rpart)
pause()
mifemb.rpart <- prune(mifem.rpart, cp=0.006)
print(mifemb.rpart)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.