###################################################################################
######### Fraction of Cell Volume Data - a log-power-exponential model ###########
###################################################################################
data("Ovocytes", package="ssym")
fit <- ssym.l(log(fraction) ~ type + psp(time) | type + psp(time), data=Ovocytes,
family='Powerexp', xi=-0.55, maxiter=5000, local.influence=TRUE)
summary(fit)
################## Graph of the nonparametric effects ##################
par(mfrow=c(1,2))
np.graph(fit, which=1, exp=TRUE)
np.graph(fit, which=2, exp=TRUE)
################## Graph of deviance-type residuals ##################
plot(fit)
################## Graph of local influence measures ##################
ilm <- influence.ssym(fit)
###################################################################################
############### Textures of snacks Data - a log-Student-t model #################
###################################################################################
data("Snacks", package="ssym")
fit <- ssym.l(log(texture) ~ type + ncs(week) | type, data=Snacks,
family='Student', xi=15)
summary(fit)
################## Graph of the nonparametric effect ##################
np.graph(fit, which=1, exp=TRUE)
################## Graph of deviance-type residuals ##################
plot(fit)
###################################################################################
####################### gam.data - a Power-exponential model ####################
###################################################################################
data("gam.data", package="gam")
fit <- ssym.l(y~psp(x),data=gam.data,family="Powerexp",xi=-0.5)
summary(fit)
################## Graph of the nonparametric effect ##################
np.graph(fit, which=1)
################## Graph of deviance-type residuals ##################
plot(fit)
###################################################################################
######### Personal Injury Insurance Data - a Birnbaum-Saunders-t model ##########
###################################################################################
data("Claims", package="ssym")
fit <- ssym.l(log(total) ~ op_time | op_time, data=Claims,
family='Sinh-t', xi=c(0.1,4))
summary(fit)
################## Plot of deviance-type residuals ##################
plot(fit)
###################################################################################
######### Body Fat Percentage Data - a Birnbaum-Saunders-t model ##########
###################################################################################
data("ais", package="sn")
fit <- ssym.l(log(Bfat)~1, data=ais, family='Sinh-t', xi=c(4.5,4))
summary(fit)
id <- sort(ais$Bfat, index=TRUE)$ix
par(mfrow=c(1,2))
hist(ais$Bfat[id],xlim=range(ais$Bfat),ylim=c(0,0.1),prob=TRUE,breaks=15,
col="light gray",border="dark gray",xlab="",ylab="",main="")
par(new=TRUE)
plot(ais$Bfat[id],exp(fit$lpdf[id])/ais$Bfat[id],xlim=range(ais$Bfat),
ylim=c(0,0.1),type="l",xlab="",ylab="Density",main="Histogram")
plot(ais$Bfat[id],fit$cdfz[id],xlim=range(ais$Bfat),ylim=c(0,1),type="l",
xlab="",ylab="",main="")
par(new=TRUE)
plot(ecdf(ais$Bfat[id]),xlim=range(ais$Bfat),ylim=c(0,1),verticals=TRUE,
do.points=FALSE,col="dark gray",ylab="Probability.",xlab="",main="ECDF")
###################################################################################
################### Boston Housing Data - a log-Slash model ####################
###################################################################################
#data("Boston", package="MASS")
#fit <- ssym.l(log(medv)~psp(lstat)|psp(lstat),data=Boston,family="Slash",xi=1.7)
#summary(fit)
#plot(fit)
Run the code above in your browser using DataLab