I have data from a randomized block design with 2 treatments and 4 blocks. Each block has unequal size of subjects: only 1 subject for treatment A and a different number of subject from treatment B for each of the 4 blocks. I need to generate a graph showing the mean and error bar for each treatment group. I used the following code: proc glm; class trt block; model outcome=trt block; lsmean trt/stderr; run; I then use the lsmean and stderr to generate a bar graph for treatment A and B. However, it gave me a pause when I saw the stderr generated by this model for treatment A is almost 3 times higher than the raw data using proc mean (var outcome; where trt='A';), for which I only have 1 pt per block. Is my glm model correct? I think for my bar graph I should use the SE from proc means. Any insight would be greatly appreciated.
... View more