umx icon indicating copy to clipboard operation
umx copied to clipboard

plot: detect paths that are definition variables and show label instead of value

Open tbates opened this issue 6 years ago • 3 comments

Problem: plot shows the values on paths. But for label = "data.def", this is misleading (value is whatever the path was fixed at, and the path takes a subject-specific value...

Desired: plot.MxRamModel checks the label for each path, and, if it matches ^data\., shows this label on the path, even if pathLabels = values for the overall model.

note: relevant for #74, moderatedBy

tbates avatar Jun 02 '19 13:06 tbates

moderator with label

tbates avatar Jun 03 '19 18:06 tbates

It would be nice to have a defvar.row= argument so that any value in the dataset could be displayed. Another option would be to put the minimum & maximum values. Later on we can put a violin plot on it :).

mcneale avatar Jun 04 '19 08:06 mcneale

This would be a test model

# Easier to add xy to data...
x     = "disp"
y     = "mpg"
def   = "am"
dummy = paste0(x, "_by_", def)
m1 = umxRAM("def_test", data = mtcars,
	umxPath(v.m. = c(x, y, def)),
	umxPath(c(x, def), to = "mpg"),
	umxPath(v0m0 = dummy), # latent called `x_by_def` with 0 variance and mean
	umxPath(x, to = dummy, fixedAt= 0, label = paste0("data.", def)),
	umxPath(dummy, to = y)
)

tbates avatar Jun 30 '19 22:06 tbates