Following four plots from a fitted threshpt object are provided:
Plot 1: plot for a response variable on the natural cubic spline of a exposure variable
Plot 2: plot for fitted response values with other mean covariates and 95% confidence intervals
Plot 3: plot for fitted response values
Plot 4: deviance by threshold point plot
When TRUE (default) upper and lower confidence interval lines are added to the plot 1 and 4. When FALSE, otherwise.
expdf
Degree of freedom of natural cubic spline function for the main exposure variable in plot 1; default value is four.
xlim
The x limits of the plot.
ylim
The y limits of the plot.
xaxt
A character which specifies the x axis type.
yaxt
A character which specifies the y axis type.
col.value
The color of main values or line in all kind of plot.
col.preval
The color of fitted value in plot 3.
col.ci
The color of confidence interval lines in plot 1 and 3.
col.vline
The color of vertical line that represents a optimum threshold in plot 2, 3 and 4.
lwd
Line width for plot 1
pch
Either an integer specifying a symbol or a single character to be used in plotting points in plot 2 and 3.
pch.preval
Either an integer specifying a symbol or a single character to be used in plotting fitted values in plot 3.
main
Overall title of the plot.
xlab
A title for the x axis of the plot
ylab
A title for the y axis of the plot
...
Not used.
Value
Generated four kind of plots from a fitted threshpt object
Author(s)
Youn-Hee Lim, Il-Sang Ohn, and Ho Kim
Examples
# read the Seoul data set and create lag variables
data(mort)
seoul = read6city(mort, 11)
seoul_lag = lagdata(seoul, c("meantemp", "mintemp", "meanpm10", "meanhumi"), 5)
# find a optimal threshold and conduct piecewise linear regression
mythresh = threshpt(nonacc ~ meantemp_m3 + meanpm10_m2 + meanhumi + ns(sn, 4*10) + factor(dow),
expvar = "meantemp_m3", family = "poisson", data = seoul_lag,
startrng = 23, endrng = 33, searchunit = 0.2)
# obtain plots
plot(mythresh, select = 1, se = TRUE, expdf=8, col.value = "blue", col.ci = "light blue")
plot(mythresh, select = 2, se = FALSE, col.vline = "orange")
plot(mythresh, select = 3, pch = 1, pch.preval = 2)
plot(mythresh, select = 4)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(HEAT)
Loading required package: splines
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HEAT/plot.threshpt.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.threshpt
> ### Title: Plots from a threshpt Object
> ### Aliases: plot.threshpt
>
> ### ** Examples
>
> # read the Seoul data set and create lag variables
> data(mort)
> seoul = read6city(mort, 11)
> seoul_lag = lagdata(seoul, c("meantemp", "mintemp", "meanpm10", "meanhumi"), 5)
>
> # find a optimal threshold and conduct piecewise linear regression
> mythresh = threshpt(nonacc ~ meantemp_m3 + meanpm10_m2 + meanhumi + ns(sn, 4*10) + factor(dow),
+ expvar = "meantemp_m3", family = "poisson", data = seoul_lag,
+ startrng = 23, endrng = 33, searchunit = 0.2)
>
> # obtain plots
> plot(mythresh, select = 1, se = TRUE, expdf=8, col.value = "blue", col.ci = "light blue")
> plot(mythresh, select = 2, se = FALSE, col.vline = "orange")
> plot(mythresh, select = 3, pch = 1, pch.preval = 2)
> plot(mythresh, select = 4)
>
>
>
>
>
> dev.off()
null device
1
>