I have IV (4 items) and DV (6 items) at the individual level and two moderators (5 items and 3 items) at the group level. How can I calculate df by hand?
Let m denote the number of observed variables (items, factor indicators, observed variables). In multilevel CFA, the degrees of freedom (df) are given as the number of pieces of information (n_i) from the observed variable (co)variance matrices and mean vector minus the number of freely estimated parameters (n_p) in your model:
df = n_i - n_p,
where n_i includes m observed variable means, (m*(m+1))/2 non-redundant (co)variances at Level 1 (the within-group level), and another (m*(m+1))/2 non-redundant (co)variances at Level 2 (the between-group level).
Software programs for multilevel CFA/SEM such as Mplus will give you all the elements in n_i when you request sample (descriptive) statistics (i.e., the mean vector as well as the Level-1 and Level-2 covariance matrices). The programs will also give you the number of freely estimated model parameters and compute the df.
Sukumaran Clementswami : The formula that you provided is not correct for multilevel CFA.
To add to Christian's answer, the DF is m(m+1)-r, see Muthen 1994, p. 383 (https://doi.org/10.1177/004912419402200300) where m is the number of observed variables and r is the number of free parameters to be estimated.
The logic here is that, following Muthen’s estimator, you first estimate within and between covariance matrices to which you fit a model consisting of within and between parts. The m(m+1) gives you the number of unique variances and covariances in the data. This is twice the normal m(m+1)/2 because each variable or pair of variables has within and between variance/covariance.