Learn R Programming

deFit (version 0.3.0)

Scale_within: Center the data according to model

Description

Center the data according to model

Usage

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

Value

dataframe

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

Examples

Run this code
#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)

Run the code above in your browser using DataLab