Dear all,
I would like to average some values inside a population of participants, my goal is that each value in the mean computation weight is the variable Freq . both the following syntax work but gives me the same values as the command without weight. Somebody could help me? Am I doing something wrong?
NB: note that freq is a non-integer number
Many thanks in advance for your time.
I would like to average some values inside a population of participants, my goal is that each value in the mean computation weight is the variable Freq . both the following syntax work but gives me the same values as the command without weight. Somebody could help me? Am I doing something wrong?
NB: note that freq is a non-integer number
Many thanks in advance for your time.
Code:
forval i = 1/24 { local varname Q1_`i' asdoc tabstat $kir if `varname' == 1 , weight(Freq) statistics(mean count) dec(2) save(TABLE3_NEW.rtf) append } forval i = 1/24 { local varname Q1_`i' asdoc tabstat $kir if `varname' == 1 [fw=Freq], s(sum) dec(2) save(TABLE3_NEW.rtf) append }
Comment