You are here

Clarification: adjusting the number of observed statistics in summary function

3 posts / 0 new
Last post
mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
Clarification: adjusting the number of observed statistics in summary function

The summary() function has a optional parameter 'numObs = X' that adjusts the number of observations to 'X' for the purposes of calculating summary statistics. I'm in the process of adding an argument 'numObs = X' to the mxAlgebraObjective() function that will increment the total number of observations in the model by 'X' for the purposes of calculating summary statistics.

Question: do we need a similar knob for the number of observed statistics in the summary() function and in the mxAlgebraObjective() function?

neale's picture
Offline
Joined: 07/31/2009 - 15:14
Hmmm. I don't see the need

Hmmm. I don't see the need for it to exist in both places, and perhaps rather tricky situations might follow if it did (conflicting or duplicate numObs's). However, I can see that the number of statistics is one thing, and the number of data records (usually the number of subjects, N) is another. For the summary stats we are presently computing, N is not used a whole lot, but for others it is quite important. Possibly, being able to adjust N would be useful.

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
OK. In the subversion

OK. In the subversion repository the functions mxAlgebraObjective() and summary() now have the optional arguments 'numObs' and 'numStats'. 'numObs' will change the number of observations in the model. 'numStats' will change the number of observed statistics in the model. For mxAlgebraObjective(), the respective contributions are added to the model. For summary(), the respective values are assigned to the model.

I admit these names are slightly confusing. The name 'numObs' comes from the argument in the mxData() function. So if we change 'numObs' we have to change mxData(), which will break some scripts. The arguments are documented in the R help for ?mxAlgebraObjective and ?summary.