LongitudinalDataTechniques纵向数据技术

上传人:ra****d 文档编号:251893401 上传时间:2024-11-11 格式:PPT 页数:24 大小:286.50KB
返回 下载 相关 举报
LongitudinalDataTechniques纵向数据技术_第1页
第1页 / 共24页
LongitudinalDataTechniques纵向数据技术_第2页
第2页 / 共24页
LongitudinalDataTechniques纵向数据技术_第3页
第3页 / 共24页
点击查看更多>>
资源描述
Click to edit Master title style,Click to edit Master text styles,Second Level,Third Level,Fourth Level,Fifth Level,*,*,*,Longitudinal Data Techniques:,Looking Across Observations,Ronald Cody,Ed.D.,Robert Wood Johnson Medical School,A Typical Longitudinal Data Set,PATNO DATE DOBHRSBPDBP,001 10/21/1997 10/21/1946 48 128 74,001 02/01/1998 44 126 70,001 11/04/1998 52 130 76,001 11/07/1998 54 132 78,003 11/11/1998 09/08/1955 52 140 80,007 04/04/1998,008 03/22/1998 02/08/1980 58 144 72,008 04/21/1998 66 144 74,012 05/06/1998 80 120 80,013 11/11/1998 11/09/1930 100 180 108,013 11/18/1998 90 170 98,123 01/28/1998 01/01/1944 80 180 96,123 05/04/1998 80 178 90,Common Data Processing Requirements,Extract the first or last visit for a subject,Copy information from the first visit to subsequent visits,Compute intra-patient statistics such as mean,median,minimum,or maximum,Common Data Processing Requirements,Count the number of visits per patient,Compute differences of variables between visits,Make decisions on the current visit,based on information from a future visit,Selecting the First(or last)Visit for Each Patient,PROC SORT DATA=LABS;,BY PATNO DATE;,RUN;,DATA FIRST;,SET LABS;,BY PATNO;,IF FIRST.PATNO;,RUN;,Listing of FIRST,PATNO DATE DOB HR SBP DBP,001 10/21/1997 10/21/1946 48 128 74,003 11/11/1998 09/08/1955 52 140 80,007 04/04/1998 .,008 03/22/1998 02/08/1980 58 144 72,012 05/06/1998 .80 120 80,013 11/11/1998 11/09/1930 100 180 108,123 01/28/1998 01/01/1944 80 180 96,354 04/12/1998 07/07/1955 90 210 110,554 06/08/1998 09/12/1944 48 108 66,888 01/01/1998 03/14/1922 46 110 68,DATA LAST;,SET LABS;,BY PATNO;,IF LAST.PATNO;,RUN;,Adding DOB to the Second Through the Last Observation for Each Patient,PROC SORT DATA=LABS;,BY PATNO DATE;,RUN;,DATA LAB2;,SET LAB;,BY PATNO;,RETAIN OLD_DOB;,IF,FIRST.PATNO,THEN OLD_DOB=DOB;,ELSE DOB=OLD_DOB;,RUN;,DOB Added to Observations,PATNO DATE DOBHRSBP DBP,001 10/21/1997 10/21/1946 48 128 74,001 02/01/1998 10/21/1946 44 126 70,001 11/04/1998 10/21/1946 52 130 76,001 11/07/1998 10/21/1946 54 132 78,003 11/11/1998 09/08/1955 52 140 80,007 04/04/1998,008 03/22/1998 02/08/1980 58 144 72,008 04/21/1998 02/08/1980 66 144 74,012 05/06/1998 80 120 80,013 11/11/1998 11/09/1930 100 180 108,013 11/18/1998 11/09/1930 90 170 98,123 01/28/1998 01/01/1944 80 180 96,123 05/04/1998 01/01/1944 80 178 90,Computing Differences Between Observations,(using RETAIN),*DIFFERENCE BETWEEN FIRST AND LAST VISIT;,DATA DIFFERENCE;/*NOT USING V7?*/,SET LAB2;,BY PATNO;,*REMOVE PATIENTS WITH ONE VISIT;,IF FIRST.PATNO AND LAST.PATNO THEN DELETE;,RETAIN R_HR R_SBP R_DBP;,IF FIRST.PATNO THEN DO;,R_HR =HR;,R_SBP=SBP;,R_DBP=DBP;,END;,(continued),Computing Differences Between Observations,(using RETAIN),(continued),IF LAST.PATNO THEN DO;,DIFF_HR =HR-R_HR;,DIFF_SBP=SBP-R_SBP;,DIFF_DBP=DBP-R_DBP;,OUTPUT;,END;,DROP R_:;,RUN;,Computing Differences Between Observations,(using RETAIN),Listing of data set difference,D D,D I I,I F F,P F F F,A D F _ _,O T A D S D _ S D,b N T O H B B H B B,s O E B R P P R P P,1 001 11/07/1998 10/21/1946 54 132 78 6 4 4,2 008 04/21/1998 02/08/1980 66 144 74 8 0 2,3 013 11/18/1998 11/09/1930 90 170 98 -10 -10 -10,4 123 05/04/1998 01/01/1944 80 178 90 0 -2 -6,Computing Differences Between the First and Last Visit(using LAG),DATA DIFF3;,SET LABS2;,BY PATNO;,*Remove patients with one visit;,IF FIRST.PATNO AND LAST.PATNO THEN DELETE;,IF FIRST.PATNO OR LAST.PATNO THEN DO;,DIFF_HR =HR-LAG(HR);,DIFF_SBP=SBP-LAG(SBP);,DIFF_DBP=SBP-LAG(DBP);,END;,IF LAST.PATNO THEN OUTPUT;,RUN;,Note:About the only time I ever executed a LAG function,conditionally(on purpose),Computing Differences Between Observations,(using the LAG function),*DIFFERENCES BETWEEN ALL VISITS;,DATA DIFF2;,SET LAB2;,BY PATNO;,DIFF_HR=HR-LAG(HR);,*Alternative(below)using the DIF function;,DIFF_SBP=DIF(SBP);,DIFF_DBP=DIF(DBP);,IF NOT FIRST.PATNO THEN OUTPUT;,RUN;,Computing Differences Between Observations,(using the LAG function),Listing of data set diff2,D D,D I I,I F F,P F F F,A D F _ _,O T A D S D _ S D,b N T O H B B H B B,s O E B R P P R P P,1 001 02/01/1998 10/21/1946 44 126 70 -4 -2 -4,2 001 11/04/1998 10/21/1946 52 130 76 8 4 6,3 001 11/07/1998 10/21/1946 54 132 78 2 2 2,4 008 04/21/1998 02/08/1980 66 144 74 8 0 2,5 013 11/18/1998 11/09/1930 90 170 98 -10 -10 -10,6 123 05/04/1998 01/01/1944 80 178 90 0 -2 -6,Counting the Number of Observations in Each BY Group,DATA COUNT_IT;,SET LABS2,(KEEP=PATNO),;,BY PATNO;,IF FIRST.PATNO THEN N_VISITS=1;,ELSE N_VISITS+1;,IF LAST.PATNO THEN OUTPUT;,RUN;,Listing of data set COUNT_IT,Obs PATNO N_VISITS,1 001 4,2 003 1,3 007 1,4 008 2,5 012 1,6 013 2,7 123 2,Using PROC FREQ to Output a Data Set Containing Counts,PROC FREQ DATA=LABS2,NOPRINT,;,TABLES PATNO/,OUT=COUNTS(KEEP=PATNO COUNT,RENAME=(COUNT=N_VISITS);,RUN;,Listing of data set COUNTS,Obs PATNO N_VISITS,1 001 4,2 003 1,3 007 1,4 008 2,5 012 1,6 013 2,7 123 2,Creating Summary Data Sets Using PROC MEANS,PROC MEANS DATA=LABS2,NWAY NOPRINT,;,CLASS PATNO;,VAR HR
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 商业管理 > 商业计划


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!