View source: R/pk_trendyspline.R
trendyspliner | R Documentation |
Test for a significant non-zero trend in a response over time.
Permutation to test whether there is a non-zero trend among a set of individuals/samples over a continuous variable -- such as time. So, there does not need to be two groups in this test. The x variable datapoints are permuated within each case/individual, thus maintaining the distribution in the y component but shuffling the hypothesized trend.
data |
A dataframe object containing your data. |
category |
The column name of the category to be tested, if present. |
cases |
The column name defining the individual cases, e.g. patients. |
group |
If more than one group in the data, the group to compare. |
mean_center |
Before processing, mean center data by individual/case (default FALSE) |
perms |
The number of permutations to generate |
set_spar |
Set the spar parameter for splines |
cut_low |
Remove data with fewer than __ points |
ints |
Number of x intervals over which to measure area |
quiet |
Silence all text outputs |
x |
The independent variable; is continuous, e.g. time. |
y |
The dependent variable; is continuous, e.g. temperature. |
The data object needs to be organized with each observation as a row, and have a column that identifies the case, patient, animal, etc, and columns with the continuous x and y variables (row with x = NA will be removed). If there are multiple groups in the data, you can filter to the single group of interest with the category and group arguments. Otherwise it assumes the entire dataset is the single population.
result <- trendyspliner(data = ChickWeight, xvar = 'Time', yvar = 'weight', category = 'Diet', cases = 'Chick', group = '1') result$pval
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.