# Additive regression for the melanoma data

 

#The commands below assume that

# 1) the melanoma data set has been stored in the dataframe "melanoma"

# 2) the survival library has been attached

# 3) the addreg package has been sourced (see under computing for instructions)

 

# Fit an additive regression model for gender,

# plot the cumulative regression functions,

# and display a summary (including test statistics):

addreg.mel<- addreg(Surv(lifetime,status==1)~sex, data=melanoma)

plot(addreg.mel)

summary(addreg.mel)

 

# Fit an additive regression model for gender, thickness (subtracted its mean) and ulceration

# plot the cumulative regression functions, and display a summary:

addreg.mel<- addreg(Surv(lifetime,status==1)~sex+ulcer+I(thickn-2.92), data=melanoma)

plot(addreg.mel)

summary(addreg.mel)