This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-use-GROUP-BY-to-concatenate-strings-in-SAS-proc-SQL/td-p/208967*/ | |
data want (drop=string_old); | |
set tmp (rename=(string=string_old)); | |
by id; | |
retain string; | |
length string $ 20; * set large enough to accommodate the maximum number of records per ID; | |
if first.id then string = ''; | |
string = catx(',',trim(string),string_old); | |
if last.id then output; | |
run; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%macro aloop; | |
%do i = 65 %to 90; | |
data mydata%sysfunc( byte(&i) ) ; | |
A=1; | |
run; | |
%end; | |
%mend; | |
%aloop; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%macro chloop; | |
%let loopval= A B C D E; | |
%do i=1 %to %sysfunc(countw(&loopval)); | |
%let j=%scan(&loopval,&i); | |
data mydata&j; | |
A=1; | |
run; | |
%end; | |
%mend; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%macro dloop; | |
%let loopval=1 2 3 5; | |
%do i=1 %to %sysfunc(countw(&loopval)); | |
%let j=%scan(&loopval,&i); | |
data mydata&j; | |
A=1; | |
run; | |
%end; | |
%mend; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc sql outobs=1000; | |
select A | |
from work.hoge | |
where A > 30 | |
; | |
quit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"color_scheme": "Packages/One Dark Material - Theme/schemes/OneDark.tmTheme", // カラースキーム | |
"theme": "Material-Theme-Darker.sublime-theme", // テーマ | |
"material_theme_small_tab" : true, // タブを小さく | |
"material_theme_small_statusbar" : true, // ステータスバーを小さく | |
"material_theme_compact_sidebar" : true, // サイドバーを小さく | |
"material_theme_compact_panel" : true, // 検索窓を小さく | |
"font_face": "Ricty Diminished", // フォント | |
"font_size": 16, // フォントサイズ | |
"font_options": [ "gray_antialias", "subpixel_antialias" ], // RetinaのMacとWindows場合 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data | |
{ | |
int<lower=0> N; //サンプルサイズ(ユニークな個人) | |
int<lower=0> NT; //サンプルサイズ(全体) | |
int<lower=0, upper=1> y[NT]; //目的変数(離反) | |
int id[NT]; //ユニークな個人の数 | |
vector[2] x[NT]; //切片と価格 | |
vector[10] w[NT]; //環境変数 | |
matrix[N,4] z; //属性 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options ls=78; | |
title "Bivariate Normal Density"; | |
%let r=0.7; | |
data a; | |
pi=3.1416; | |
do x1=-4 to 4 by 0.1; | |
do x2=-4 to 4 by 0.1; | |
phi=exp(-(x1*x1-2*&r*x1*x2+x2*x2)/2/(1-&r*&r))/2/pi/sqrt(1-&r*&r); | |
output; | |
end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data cdf; | |
do x = -3 to 3 by 0.1; | |
y = cdf("Normal", x); | |
output; | |
end; | |
run; | |
ods graphics / height=500; | |
proc sgplot data=cdf noautolegend; | |
title "Normal Cumulative Probability"; |