如何合并具有某些重复值的单个数据集中的行?

时间:2019-05-08 20:15:56

标签: merge sas duplicates

我正在分析病历数据集,其中在4个不同时间点对患者进行了性传播感染筛查。数据管理器在每个时间段为每个STI的每位患者创建了一条线路。我要合并数据集,因此每个患者在每个时间点只有一行,列出了所有已诊断的STI。

我创建了新变量来捕获将在Dx变量下列出的每个STI,但是我无法弄清楚如何在同一数据集中合并数据,因此每个患者在每个时间点只有一个。

data dx; 
set dx; 
if dx='ANOGENITAL WARTS (CONDYLOMATA ACUMINATA)' then MRWarts=1;
if dx='CHLAMYDIA' then MRCHLAMYDIA=1;
if dx='DYSPLASIA (ANAL, CERVICAL, OR VAGINAL)' then MRDYSPLASIA=1;
if dx='GONORRHEA' then MRGONORRHEA=1;
if dx='HEPATITIS B (HBV)' then MRHEPB=1;
if dx='HUMAN PAPILLOMAVIRUSES (HPV)-ANY MANIFESTATION' then MRHPV=1;
if dx='PEDICULOSIS PUBIS' then MRPUBIS=1;
if dx='SYPHILIS' then MRSYPHILIS=1;
if dx='TRICHOMONAS VAGINALIS' then MRTRICHOMONAS=1;
run;

Image of data structure I am looking for

1 个答案:

答案 0 :(得分:0)

获取图像中提供的样本数据集,您可以使用简单的转置以获得所需的结果。

If you want to clear MS Teams cache, you could refer to the following ways:

1.  Fully exit the Microsoft Teams desktop client. To do this, either right click Teams from the Icon Tray and select ‘Quit’, or run Task Manager and fully kill the process.
2.  Go to File Explorer, and type in %appdata%\Microsoft\teams.
3.  Once in the directory, you’ll see a few of the following folders:

 a.  From within ‘Application Cache’, go to Cache and delete any of the files in the Cache location.
    *   %appdata%\Microsoft\teams\application cache\cache

 b.  From within ‘Blob_storage’, delete any files that are located in here if any.
    *   %appdata%\Microsoft\teams\blob_storage

 c.  From within ‘Cache’, delete all files.
    *   %appdata%\Microsoft\teams\Cache

 d.  From within ‘databases’, delete all files.
    *   %appdata%\Microsoft\teams\databases

 e.  From within ‘GPUCache’, delete all files.
    *   %appdata%\Microsoft\teams\GPUcache

 f.  From within ‘IndexedDB’, delete the .db file
    *   %appdata%\Microsoft\teams\IndexedDB

 g.  From within ‘Local Storage’, delete all files.
    *   %appdata%\Microsoft\teams\Local Storage

 h.  Lastly, from within ‘tmp’, delete any file.
    *   %appdata%\Microsoft\teams\tmp

4. Once finally done clearing, you can now restart Teams from your local desktop and all cache will be cleared from the desktop app.

现在,此代码将创建除interval_round以外的所有变量,例如,假设-在第1轮中筛查了一名患者的艾滋病毒,在第2轮中筛查了疣,从技术上讲,它应该只有一行..那么,您将如何表示interval_round?