Conversion of counts (or rates) to 'Proportion'
This function converts counts or rates to proportions.
props(traj, id_field = TRUE, scale = 1, digits = 4)
traj |
[matrix (numeric)]: longitudinal data. Each row represents an individual trajectory (of observations). The columns show the observations at consecutive time points. |
id_field |
[numeric or character] Whether the first
column of the |
scale |
[numeric] To scale the 'proportion' measures.
Default: |
digits |
[numeric] Specifying number of digits to
approximate the output to. Default: |
Given a matrix of observations (counts or rates), this
function converts each observation to a proportion equivalent to
the sum of each column. In other words, each observation is divided
by the sum of the column where it is located, i.e.
prop = [a cell value] / sum[corresponding column]
A dataframe of proportion measures
trajectry <- data_imputation(traj, id_field = TRUE, method = 2, replace_with = 1, fill_zeros = FALSE) #filling the missing values trajectry <- props(trajectry$CompleteData, id_field = TRUE, scale=1, digits=4) print(trajectry)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.