Analyse linear regression for time series in batch
anylm(
df,
xd = 2,
yd = 3,
zd = NULL,
td = NULL,
mi = 1,
range.y = "interval",
range.x = "interval",
nperm = 99,
showpage = TRUE,
scint = FALSE,
dign = 1,
zfill = "lightgray",
ppsize = 2,
showinfo = TRUE,
ptsize = 12,
pncol = NULL
)
a list contains: data_list, lm_df, lm_list, plot_list, all_plot.
data_list: a list contains data for linear regression.
lm_df: a dataframe for key results of linear regression. row index of lm_df corresponds to 'id' of plot in 'all_plot'.
lm_list: a list contains detail results of linear regression.
plot_list: a list contains plots for linear regression.
all_plot: a page for all plots in 'plot_list'.
To see page, please use this function: 'gridExtra::grid.arrange(grobs=...)'.
To see page, please use this 2-lines function:
'g=gridExtra::arrangeGrob(grobs=...)',
'ggplot2::ggsave(filename = "example.jpg", plot =g)'.
'id' of plot corresponds to row index of 'lm_df'.
dataframe of time series.
species or columns for x axis, vector of number or colnames. Default vaule is '2'.
species or columns for y axis, vector of number or colnames. Default vaule is '3'.
species or columns to fill points, vector of number or colnames. Default vaule is 'NULL'. If zd is setted, labels for scaled color represent Percentile value (0, 0.25, 0.5,0.75, 1).
1 column to group data, number or colname. Default vaule is 'NULL'.
index (1~4) of methods: 1. ordinary least squares (OLS); 2. major axis (MA); 3. standard major axis (SMA); 4. and ranged major axis (RMA). Refered from R package 'lmodel2'. Default vaule is '1'.
Parametres for ranged major axis regression (RMA). If range.y = NULL and range.x = NULL, RMA will not be computed. If only one of them is NULL, the program will stop. If range.y = "relative": variable y has a true zero (relative-scale variable). If range.y = "interval": variable y possibly includes negative values (interval-scale variable). If range.x = "relative": variable x has a true zero (relative-scale variable). If range.x = "interval": variable x possibly includes negative values (interval-scale variable). Refered from R package 'lmodel2'.
Parametres, please see 'range.y'.
Number of permutations for the tests. If nperm = 0, tests will not be computed. Refered from R package 'lmodel2'.
logical value for showing all plots. If TRUE, print all plot in 1 page. Default vaule is 'TRUE'.
logical value for displaying scientific notion in legend and plot title. Default vaule is 'FALSE'.
numeric value for digists in legend and plot title. Default vaule is '1'.
color for points, only valid when zd is NULL. Default vaule is "lightgray".
size for points. Default vaule is "lightgray".
logical value for displaying regression information in plot title. Default vaule is 'TRUE'.
font size for plot title. Default vaule is '12'.
number of columns for plots in page. Refered from R package 'gridExtra'. Default vaule is 'NULL'.
X axis, Y axis, scaled color for points are flexible for multiple columns.
Data could also be grouped according to 1 column.
anylm(aqi, xd=c(2,3), yd=6, zd=4, td=NULL, dign=3)
Run the code above in your browser using DataLab