Scale_within: Center the data according to model

View source: R/Scale_within.R

Scale_withinR Documentation

Center the data according to model

Description

Center the data according to model

Usage

Scale_within(userdata, model = NA, center = FALSE, scale = FALSE)

Arguments

userdata

users' data

model

a string specifying the model to be used. The "=~" operator is used to define variables, with the name of the variable user defined on the left and the name of the variable in the data on the right. The '~' operator specifies a differential equation, with the dependent variable on the left and the independent variables on the right. See also ‘Details’.

center

TRUE or FALSE

scale

TRUE or FALSE

Value

dataframe

Examples

#eg1.
data('example3')
multi_model <- '
  X =~ current
  time =~ myTime
  X(2) ~ X(1) + X + (1 + X(1) + X | year)
  '
scale_mydata <- Scale_within(example3[(example3["year"] >= 2015)&(example3["year"] <= 2018),]
,multi_model
,center=TRUE)

deFit documentation built on Oct. 18, 2024, 5:14 p.m.

Related to Scale_within in deFit...