Skip to contents

This function scales the measured values of an scdf file. It allows for mean centering and standardization across all cases included in an scdf.

Usage

rescale(data, ..., m = 0, sd = 1)

Arguments

data

A single-case data frame. See scdf() to learn about this format.

...

Names of variables to be standardized.

m

The target mean. If set NULL, it is not changed.

sd

The target standard deviation. If set NULL, it is not changed.

Value

An scdf with the scaled values.

See also

Author

Juergen Wilbert

Examples


## Standardize a multiple case scdf and compute an hplm
exampleAB_50 |>
  rescale(values, mt) |>
  hplm()
#> Hierarchical Piecewise Linear Regression
#> 
#> Estimation method ML 
#> Contrast model: W / level: first, slope: first
#> 50 Cases
#> 
#> ICC = 0.287; L = 339.0; p = 0.000
#> 
#> Fixed effects (values ~ 1 + mt + phaseB + interB)
#> 
#>                    B    SE   df       t p
#> Intercept     -1.251 0.075 1328 -16.716 0
#> Trend mt       0.242 0.048 1328   5.006 0
#> Level phase B  0.708 0.033 1328  21.436 0
#> Slope phase B  0.377 0.050 1328   7.588 0
#> 
#> Random effects (~1 | case)
#> 
#>           EstimateSD
#> Intercept      0.503
#> Residual       0.266