Hi,
I am trying to get univariate results for each of a number of variables. Following Nick's example in "How to face lists with fortitude", I tried:
local intint AgeAtHAART YearsOfVL_FU_afterSuccess400 YearsSpentUndetectable PeakVLBefARVs BaselineCD4 MaxCD4At2y PercentCD4Change AbsIncrease2y RDWatHAART WBCatHAART HgbAtHAART MCVatHAART PLTatHAART SCrAtHAART eGFRHAART SCrAtImmuneFail eGFRImmuneFail AZTd4T_PeriodsDuringObs AZTd4Ttime FolInh_PeriodsDuringObs FolateInhTime ACEI_PeriodsDuringObs ACEItime ARB_PeriodsDuringObs ARBtime RTVperiodsDuringObs RTVtime
foreach x of var `intint' {
ranksum `x', by(CD4Above350At2y)
}
This yields a varlist required error.
I also tried:
foreach var in `intint'{
ranksum `var', by(CD4Above350At2y)
}
This simply yields end of do-file, but no results are shown.
I searched for foreach here, and didn't find a relevant answer. Elsewhere in the do-file, I have:
tabstat `intint', by(CD4Above350At2y) columns(statistics) statistics(n p50 p25 p75) longstub varwidth(30)
, and this behaved exactly as expected, which suggests to me that the local macro intint does contain what it was intended to.
What am I doing wrong, please?
I am trying to get univariate results for each of a number of variables. Following Nick's example in "How to face lists with fortitude", I tried:
local intint AgeAtHAART YearsOfVL_FU_afterSuccess400 YearsSpentUndetectable PeakVLBefARVs BaselineCD4 MaxCD4At2y PercentCD4Change AbsIncrease2y RDWatHAART WBCatHAART HgbAtHAART MCVatHAART PLTatHAART SCrAtHAART eGFRHAART SCrAtImmuneFail eGFRImmuneFail AZTd4T_PeriodsDuringObs AZTd4Ttime FolInh_PeriodsDuringObs FolateInhTime ACEI_PeriodsDuringObs ACEItime ARB_PeriodsDuringObs ARBtime RTVperiodsDuringObs RTVtime
foreach x of var `intint' {
ranksum `x', by(CD4Above350At2y)
}
This yields a varlist required error.
I also tried:
foreach var in `intint'{
ranksum `var', by(CD4Above350At2y)
}
This simply yields end of do-file, but no results are shown.
I searched for foreach here, and didn't find a relevant answer. Elsewhere in the do-file, I have:
tabstat `intint', by(CD4Above350At2y) columns(statistics) statistics(n p50 p25 p75) longstub varwidth(30)
, and this behaved exactly as expected, which suggests to me that the local macro intint does contain what it was intended to.
What am I doing wrong, please?
Comment