⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yydyt13a.sas

📁 高老师的经典多元统计分析教材源代码非常经典使用
💻 SAS
字号:
 /* yydyt13a.sas  */

data d131;
  input num x1-x5;
  cards;
1 99 94 93 100 100
2 99 88 96  99  97
3 100 98 81 96 100
4 93 88 88  99  96
5 100 91 72 96  78
6 90 78 82  75  97
7 75 73 88  97  89
8 93 84 83  68  88
9 87 73 60  76  84
10 95 82 90 62  39
11 76 72 43 67  78
12 85 75 50 34  37
;
proc transpose data=d131 out=d131t prefix=n;
  var x1-x5;
run;
data d131t;
  set d131t;
  n=_n_;
run;
proc print;
  var n n1-n12;
run;
data d131f(keep=f1-f12 t);
  set d131t;
  retain f1-f12;
  array f(12) f1-f12 ;
  array nn(12) n1-n12;
  do t=-3.14 to 3.14 by 0.1; 
    do i=1 to 12;
       if _n_=1 then f(i)=nn(i)/sqrt(2);
       if _n_=3 then f(i)=f(i)+nn(i)*cos(t);
       if _n_=2 then f(i)=f(i)+nn(i)*sin(t);
	   if _n_=4 then f(i)=f(i)+nn(i)*sin(2*t);
	   if _n_=5 then f(i)=f(i)+nn(i)*cos(2*t);
	end;
	if _n_=5 then output;
  end;
run;
proc print data=d131f;
run; 

title;
goptions reset=global ;/* htitle=2 htext=2;*/
symbol1  i=spline c=red; 
symbol2  i=spline c=blue; 

proc gplot data=d131f;
  plot f1*t f12*t/overlay;
run;
/*
data d13a;
  do t=-3.14 to 3.14 by 0.1;
    f1=99/sqrt(2)+94*sin(t)+93*cos(t)+100*sin(2*t)+100*cos(2*t);
	f12=85/sqrt(2)+75*sin(t)+50*cos(t)+34*sin(2*t)+37*cos(2*t);
	output;
  end;
run;
proc gplot data=d13a;
  plot f1*t f12*t/overlay;
run;

*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -