I saw a thread discussing about integration of sample weights with likelihood but I still was not able to work out the code given in that thread. The code I used and worked out is stated below (from an earlier thread):
fullModel <- mxModel("ThisIsHowYouDoWeights",
mxFIMLObjective("myCov", "myMeans", dims, vector=TRUE)),
mxAlgebra(-2 * sum(data.weight %x% log(firstModel.objective), name="obj"),
with data.weight being a vector (in my case) and the firstModel.objective (also a vector) is calculated differently (not with vector=TRUE) because it was not working for me.
My analysis is about estimation of parameters from a one-factor model (with sampling weights). The model without the sampling weights (normal model) works alright but there were some issues with extracting the likelihood vector when vector=TRUE on mxFIMLObjective. I then decided to use another code from the website of OpenMx (using the formula of row-likelihood) and I was able to extract the likelihoods with it. Now, with available sample weights and the vector of likelihoods, I was wondering if there is another way to tackle this issue? Also, in my case, because data.weight is a vector as well the firstModel.objective, I multiplied them both (*) instead of using Kronecker multiplication (I thought it was correct?).
Thank you in advance for your suggestions and tips.