vlda: Visualization of Longitudinal Data Analysis

Description Usage Arguments Details Value See Also Examples

View source: R/vlda_main.R

Description

Visualization of multidimensional longitudinal data based on the projection method using the indicator matrix.

Usage

1
vlda(x, object, time, type = c("long", "wide"))

Arguments

x

A data frame consisting of categorical data coded in numbers. Its n samples(object) should have been repeatedly measured through multiple time points; its p variables will be represented as variable coordinate. To keep track of which observation occurred in which time point, you must have included a variable, Time.

object

A vector of length n samples. The object who would have made repeatedly measure through multiple time points; the object is indicated by the name of the observation coordinate.

time

A time point of longitudinal data. Accepts a character string that denotes the name of the time variable.

type

A type of longitudinal data.

Details

The value returned by vlda is using as the main argument of vlda_plot and vlda_add function, the corresponding model. long-format is that each row is one time point per object So each object has T rows. All T values for each object are stacked–they're all in the one column; wide-format is that a object repeated responses will be in a single row, and each response is in a separate column. so (Y_{1}, … ,Y_{T}) are the response variables obtained at time t(=1,… ,T).type = c(long, wide)

Value

obs.coordinate

A tibble data class of row coordinates. Each row represents row coordinates and the observations corresponding to each row are included in the obs_list

var.coordinate

The column coordinate.

Eigen

Summarize the principal inertias(Eigenvalues) that as a result of applying the above algorithm using the indicator matrix

GOF

Goodness-of-fit of the Approximation for 2-dimensional VLDA plot.

See Also

vlda_add
vlda_plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## longform of the PTSD data
data(PTSD)
PTSD <- as.data.frame(PTSD)
PTSD[,2:4] <- apply(PTSD[,2:4], 2, function(x) ifelse(x >= 3, 1, 0))
PTSD[,5] <-  ifelse(PTSD[,5] >= 6 , 1, 0)
PTSD <- data.frame(lapply(PTSD, function(x) as.factor(x)))
vlda(x = PTSD, object = "subject", time = "time", type = "long")


## Wideform od the Depression data
data(Depression)
head(Depression)
vlda(Depression, object = "Case", time = c("1week", "2weeks", "4weeks"), type = "wide")
vlda(Depression, "Case", c("1week", "2weeks", "4weeks"), "wide")

vlda documentation built on July 1, 2020, 10:15 p.m.

Related to vlda in vlda...