freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

創(chuàng)建數(shù)據(jù)集ppt課件(編輯修改稿)

2025-02-08 10:36 本頁面
 

【文章內(nèi)容簡介】 以用在報表中。 ( 3)變量存儲長度( Length): 數(shù)值數(shù)據(jù)一般長度為 8字節(jié),也可以對取值較小的數(shù)值規(guī)定較小的長度以節(jié)省存儲空間;字符型變量的缺省長度為 8字節(jié)。 Statistical Analysis System Data Step ? 變量的屬性: ( 4)變量的輸出格式( format): 指定如何顯示變量的值。 ( 5)變量的輸入格式( informat): 指定如何把外部數(shù)據(jù)轉換為 SAS數(shù)據(jù)。 ? 數(shù)據(jù)步中的 Attrib語句可以指定這些屬性,格式為: Attrib 變量名 屬性名 =屬性值 … 。 Statistical Analysis System Data Step /* */ data sales。 ATTRIB name LABEL=姓名 LENGTH=$10 date LABEL=日期 FORMAT=yymmdd10. INFORMAT=mmddyy10. amount LABEL=金額 FORMAT=。 input name $ 110 date amount。 cards。 張鵬 10/15/1998 2022 李志明 1/3/99 1500 王敏 11/5/99 3000 。 run。 proc print noobs label。 run。 ? 可以同時指定多個變量的屬性; ? 可以為一個變量同時指定多個屬性。 Statistical Analysis System 加工數(shù)據(jù)集 ? 用 Set語句 復制數(shù)據(jù)集 /* */ data c9501。 set 。 run。 ? 把 ? 該程序流程也隱含著一個循環(huán),其中的 set語句是讀取觀測的語句。 Statistical Analysis System 加工數(shù)據(jù)集 ? 修改 數(shù)據(jù)集 /* */ data c9501。 set 。 if height170 then height=170。 run。 ? 原數(shù)據(jù)集中趙大可身高 172,修改后為 170; Statistical Analysis System 加工數(shù)據(jù)集 ? 使用 Keep語句指定保留數(shù)據(jù)集中的變量,Drop語句指定丟棄數(shù)據(jù)集中的變量。 /* */ data c9501。 set 。 Keep name height weight。 run。 ? 生成新數(shù)據(jù)集,保留原數(shù)據(jù)集中 name、 height、weight三個變量; Statistical Analysis System 加工數(shù)據(jù)集 /* */ data c9501。 set 。 drop age,sex。 run。 ? 丟棄 age、 sex變量,與上例作用相同; ? 用這種方法可以 取得數(shù)據(jù)集的某些列的子集 。 Statistical Analysis System 加工數(shù)據(jù)集 /* */ data c9501a。 set c9501。 if height150 and weight50。 run。 ? 也可以 取得數(shù)據(jù)集的某些行的子集 。 ? 身高大于 150cm, 并且體重大于 50kg的觀測。 ? 這里 if語句不同于分支語句,它沒有 then部分。用于取出滿足條件的行,形成子集。 Statistical Analysis System 加工數(shù)據(jù)集 ? 利用 Ifthen結合 Delete篩選數(shù)據(jù)集 /* */ data c9501。 set c9501。 if height150 then Delete。 run。 ? 程序執(zhí)行后 ,身高小于 150的記錄均被刪除。 Statistical Analysis System 加工數(shù)據(jù)集 ? 在用 Set語句引入數(shù)據(jù)集時,可以給數(shù)據(jù)集加選項,格式為: 數(shù)據(jù)集名(數(shù)據(jù)集選項); ? 選項包括: ? Keep=: 表示引入時只要指定的變量; ? Drop=: 表示不引入指定的變量; ? Obs=: 表示讀取觀測時,讀到指定的序號為止; ? FristObs:表示從指定的序號開始讀起,不讀取序號之前的觀測。 Statistical Analysis System 加工數(shù)據(jù)集 /* */ data huge。 array x(10)。 do i=1 to 1000000。 do j=1 to 10。 x(j) = normal(0)。 end。 output。 end。 drop i j。 run。 data new。 set huge(obs=100 keep=X1 X2)。 run。 ? 產(chǎn)生一個 10個變量,1百萬個觀測的數(shù)據(jù)集 ; ? 從中復制前 100行和兩個變量,形成新數(shù)據(jù)集 。 Statistical Analysis System 加工數(shù)據(jù)集 ? 拆分 數(shù)據(jù)集 /* */ data datam dataf。 set 。 select(sex)。 when(39。男 39。) output datam。 when(39。女 39。) output dataf。 otherwise put sex=39。有錯 39。 end。 drop sex。 run。 proc print data= datam。run。 proc print data= dataf。run。 ? 把 據(jù)集中的男生放到,將女生放到。 ? Output是一個可執(zhí)行語句,它強制當前觀測寫入到語句指定的數(shù)據(jù)集中。 Statistical Analysis System 加工數(shù)據(jù)集 ? 縱向合并 數(shù)據(jù)集 ? 幾個結構相同的數(shù)據(jù)集上下地合并在一起; ? 比如: Data Classes。 set Class1 class2 class3 class4。 Run。 Classes Class1 Class2 Class3 Class4 Statistical Analysis System 加工數(shù)據(jù)集 Statistical Analysis System 加工數(shù)據(jù)集 /* */ data new。 set datam(in=male) dataf(in=female)。 if male=1 then sex=39。男 39。 if female=1 then sex=39。女 39。 run。 ? 將前例拆分的男生、女生兩個數(shù)據(jù)集合并; ? 為了指示觀測來自哪一個小數(shù)據(jù)集,在 Set語句數(shù)據(jù)集名后可加一個小括號,里面加上 “ In=變量名 ” ,該變量取 1時表示觀測來自該數(shù)據(jù)集,取 0時不是來自該數(shù)據(jù)集。 Statistical Analysis System 加工數(shù)據(jù)集 ? 橫向合并 數(shù)據(jù)集 ? 兩個(或多個)數(shù)據(jù)集如果包含了同樣一些觀測的不同屬性(變量),且各個數(shù)據(jù)集的觀測順序是一一對應的,則可以通過 Merge語句合并到一個新數(shù)據(jù)集; ? 比如: data new。 merge c9501u c9501v c9501w。 run。 Statistical Analysis System 加工數(shù)據(jù)集 ? 如果順序不對應,則合并結果不正確。所以橫向合并一般采取按關鍵字合并的方法。 ? 即把每個數(shù)據(jù)集按照相同的、能唯一區(qū)分各個觀測的一個(或幾個)變量排序,然后用by語句和 Merge語句,使原來觀測順序不一致或個數(shù)不同的數(shù)據(jù)集正確合并。 Statistical Analysis System 加工數(shù)據(jù)集 Statistical Analysis System 加工數(shù)據(jù)集 /* */ data c9501x。 set 。 keep name sex。 run。 data c9501y。 set 。 keep name height weight。 run。 proc sort data=c9501x。 by name。 run。 proc sort data=c9501y。 by name。 run。 data new。 merge c9501x c9501y。 by name。 run。 proc print。run。 ? 把 含 name、 sex的數(shù)據(jù)集c9591x; ? 把 含 name、 height、weight的數(shù)據(jù)集 c9591y; ? 按關鍵字橫向合并。 ? Sort是排序過程。 Statistical Analysis System Proc Step ? SAS程
點擊復制文檔內(nèi)容
教學課件相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1