t**********r 发帖数: 182 | 1 data set is like this:
PlantID Year Month Month_grow_rate
How can I create another database that include all PlantID having previous
TWO years' data of Month_grow_rate?
Thanks. |
|
s*****n 发帖数: 3416 | 2 correct some mistakes:
proc sql;
create table out as
select a.plantID,a.dateofobservation,a.growthrate,count(b.dateofobservation)
as
obs_cnt,
mean(b.growthrate) as mean_rate, mean((b.growthrate)**2) as mean_sq
from input as a left join input as b
on a.plantid=b.plantid and
intnx("year",b.dateofobservation,1,'sameday')>=a.dateofobservation and
b.dateofobservation
group by a.plantID,a.dateofobservation,a.growthrate;
quit;
Use a small portion of your data to test. |
|
s*****n 发帖数: 3416 | 3 Let me try:
proc sql;
create table out as
select plantID dateofobservation,growth rate,count(b.dateofobservation) as
obs_cnt,
mean(b.growthrate) as mean_rate, mean((b.growthrate)**2) as mean_sq
from input as a left join input as b
on a.plantid=b.plantid and
intx(b.dateofobservation,'year',1,'act/act')>=a.dateofobservation and
b.dateofobservation
quit;
data output;
set output;
growvalatility=sqrt((mean_sq-mean_rate**2)/obs_cnt);
run;
Idea: I don't know SAS has standard deviat |
|
t**********r 发帖数: 182 | 4 PlantID, dateofobservation (YYYYMMDD), growth rate,
xxxxxxx, xxxx, xxxx,
xxxxxxx, xxxx, xxxx,
For each month in the sample period, I need to estimate growth rate
volatility, which is defined as the annualized standard deviation of daily
growth rate over the preceding 12 months. The final dataset should be like this:
PlantID, dateofboservation, growth rate, growthrateVolatility,
The sample is huge, more than 10 thousand PlandID with 50 years record. I
tried some MACRO but my code does not work.
T |
|
w***y 发帖数: 114 | 5 I am not sure what you mean? there are multiple obs (for each year)for each
plantid?do you want to calculate std of each plant for each year, then
growth rate volatility is std of this year/std of last year.if so, the
result is one plantid will have same growth rate volatilityone for the same
year? I am wonder why do you use macro for this? |
|
s****n 发帖数: 212 | 6 一切依照版规,不退不换,邮费会按最便宜的方式收取。要是不让卖药品,版主通知一
声,我会把药品部分删掉。站内邮箱联系。
饰品按价格由高到低排序。
$3发圈(图1最右边的小熊和苹果图案及图3中樱桃图案的为发圈)
$2发抓(见图1) 发簪(见图2) 发夹(见图3) 耳环(见图4)
$1 耳环(图5,其中最后一排最左边的耳环有橙色,绿色和白色,中间的耳环有蓝色和
紫色,最右边的大圈耳环为银色款)
$1带弹性的单排钻手环(见图6)
衣服:
剪标上装$5(见图8) 均码 适合155-165的MM穿着
黄色西装$10(见图9) L码 适合165-170的MM穿着
白领连衣裙$10(见图10)L码 适合160-165稍丰满的MM或者165-170稍苗条的MM穿着
牛仔背心裙$15(见图11) 适合165-175的MM穿着
护肤品 (图12):
EL 粉眼霜 3ml, B39, $4,有3支
ORIGINS套装, 全新, 09年4/5月生产 ;
蘑菇套装$8,里面有 Plantidote mushroom face cleanser 30ml, modern
friction 30ml, plantid |
|
|
|