Description Usage Arguments Details Value Author(s) Examples

View source: R/step1measures.R

Computes 24 measures for each of the trajectories. See details for the list of measures.

1 | ```
step1measures(Data, Time, ID = FALSE, verbose = TRUE)
``` |

`Data` |
A |

`Time` |
A |

`ID` |
Logical. Set to |

`verbose` |
Logical. Set to |

There must be a minimum of 4 observations for each trajectory or the trajectory will be omitted from the analysis. The
trajectories do not need to have the same number of observations, nor the same values of `Time`

.

The `Time`

data.frame or matrix must have the same dimension as the `Data`

data frame or matrix and must not contain missing values or an error will be returned. The data can have missing values, `Time`

can not.

When `ID`

is set to `FALSE`

, a generic `ID`

variable is created and appended as the first
colunm of both the `Data`

and `Time`

data.frames.

The 24 measures are:

1. Range

2. Mean-over-time*

3. Standard deviation (SD)

4. Coefficient of variation (CV)

5. Change

6. Mean change per unit time

7. Change relative to the first score

8. Change relative to the mean over time

9. Slope of the linear model*

10. R^2: Proportion of variance explained by the linear model

11. Maximum of the first differences

12. SD of the first differences

13. SD of the first differences per time unit

14. Mean of the absolute first differences*

15. Maximum of the absolute first differences

16. Ratio of the maximum absolute difference to the mean-over-time

17. Ratio of the maximum absolute first difference to the slope

18. Ratio of the SD of the first differences to the slope

19. Mean of the second differences

20. Mean of the absolute second differences

21. Maximum of the absolute second differences

22. Ration of the maximum absolute second difference to the mean-over-time

23. Ratio of the maximum absolute second difference to mean absolute first difference

24. Ratio of the mean absolute second difference to the mean absolute first difference

* If a measure is equal to zero, it will be set to the smallest, non-zero value of the same measure across the sample during further calculations. If Y_1, the first observation of the trajectory of an individual, is equal to zero, it will aslo be replaced.

For the exact equations of the measures, please go to "User guides, package vignettes and other documentation" section of the "traj" package.

`trajMeasures` |
Object containing the data used for the calculations and the 24 measures. |

Marie-Pierre Sylvestre, Dan Vatnik

[email protected]

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
# Setup data and time
data = example.data$data
time = example.data$time
# Run step1measures
s1 = step1measures(data,time, ID=TRUE)
# Display measures
head(s1$measurments)
# Plot mean trajectory of all individuals
plot(s1$measurments$ID, s1$measurments$m5)
# The next step would be to run "step2factors"
``` |

traj documentation built on May 29, 2017, 3:50 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.