0
我正在计算年平均值和最高和最低温度的标准偏差,。我的代码如下:SAS PROC SQL计算平均值时出错
PROC SQL;
create table new2 as
select date,SUM(max_temp) as max_temp,SUM(min_temp) as min_temp,
SUM(precip) as precip
from WORK.ROCH_DATA
group by date;
create table average2 as
select year(date) as year,(date) as year2,avg(max_temp) as maxavg,
avg(min_temp) as minavg, avg(precip) as avgprecip, std(max_temp) as
stdmaxtemp,
std(min_temp) as stdmintemp,std(precip) as stdprecip
from new2
group by year;
QUIT;
我的代码最终吐在这样的东西上;
它重复YEAR2和年份列(我只想要一个用正确的一年,即1916.1917),并保持了一年重新计算。我怎么才能让我看看我的数据中50年的单一计算? (即排除重新计算)
问题是这样的代码:'年(日期)为一年,(日期)作为year'。给两列命名是没有意义的。 –
我已经纠正了,但现在它提出了另一个问题。更新一个问题的时刻。 –
删除您的第一个proc sql,并在您的work.ROCH表中指向第二个。 – Reeza