I have noticed that the Cochran-Armitage Test for Trend gives different results when an interval variable is grouped by proc format compared to recoding. For example: proc format; value EngineSizeFmt low -< 3 = "0-3" 3 -< 5 = "3-4" 5 -< 9= "5-8" ; run; proc freq data=sashelp.cars; where origin in("Europe" "USA"); tables EngineSize*origin /trend chisq nopercent norow; format EngineSize EngineSizeFmt.; run; data work.cars; set sashelp.cars; if EngineSize lt 3 then esize=1; if EngineSize ge 3 and EngineSize lt 5 then esize=2; if EngineSize ge 5 then esize=3; run; proc freq data=work.cars; where origin in("Europe" "USA"); tables ESize*origin /trend chisq nopercent norow; run; The frequencies and chi-square test are the same, the trend test is different. Any thoughts? Which should be used?
... View more