umx_wide4lmer: Take a long dataframe and make it wide for repeated measures...

umx_wide4lmerR Documentation

Take a long dataframe and make it wide for repeated measures and multi-level analysis

Description

umx_wide4lmer Transform data from wide to long format for repeated measures and multi-level modeling in R.

Wraps reshape stats::reshape()

Usage

umx_wide4lmer(
  repeated = list(y = c("y1", "y2")),
  timevar = list(cond = c("cont", "expt")),
  covs = c("Age", "Sex", "Conscientiousness"),
  data = df,
  idvar = "PID"
)

Arguments

repeated

list of repeated measures each in list(y = c("y1", "y2")) form

timevar

list of conditions in a list, e.g., list(condition = c("cont", "expt")),

covs

vector of covariates e.g., c("Age", "Sex", "Conscientiousness")

data

A (long-format) data file

idvar

The variable which links repeated measures, e.g., "ID"

References

See Also

  • umx_long2wide()

Other Miscellaneous Utility Functions: install.OpenMx(), libs(), qm(), umx, umxLav2RAM(), umxModelNames(), umxRAM2Lav(), umxVersion(), umx_array_shift(), umx_find_object(), umx_lower.tri(), umx_msg(), umx_open_CRAN_page(), umx_pad(), umx_print(), umx_wide2long()

Examples

## Not run: 
covs = c("Age", "Sex", "Conscientiousness")
timevar  = list(Difficulty = c("short", "long"))
repeated = list(
	Frustration = c("NASA_Frustration1", "NASA_Frustration2"),
	Effort      = c("NASA_Effort1"     , "NASA_Effort2"),
	Efficacy    = c("NASA_Performance1", "NASA_Performance2"), 
	Howmany     = c("howmany_30secs"   , "howmany_60secs")
)
df.l = umx_wide4lmer(repeated = repeated, timevar = timevar, covs = covs, data = df, idvar = "PID")

## End(Not run)

umx documentation built on Nov. 5, 2025, 5:26 p.m.