I am working in SAS Enterprise guide and am running a proc sql query as follows:
proc sql;
CREATE TABLE average_apples AS
SELECT farm, size, type, mean(apples) as average_apples
FROM input_table
GROUP BY farm, size, type
;
quit;
For some of the data sets I am running this query on there are groups which have no observations assigned to them, so there is no entry for them in the query output.
How can I force this query to return a row for each of my groups (for example with a value of 0
in the apples
column?
Thanks up front for the help!