Error message in running saturated 2-group model

Running line 93 command/code for the saturated 2-group model in R script “practicalDay3.R”, I got error message as follows. May you help on this?

fitGofs(fitSAT); fitEsts(fitSAT); #mxGetExpected( fitSAT, c(“means”,“covariance”) )
Error in fitGofs(fitSAT) : could not find function “fitGofs”

@anonymous3 Did you run the miFunctions.R script at the beginning? There should be a line that says source(‘miFunctions.R’). The fitGofs() function is defined there. If you don’t run, then R doesn’t know that the function exists.

I found the problem solution. Need to add one command like "setwd(’/home/username/day3’) before line 23 source(“miFunctions.R”)

1 Like