yeth
这是一个SAS程序,里面有错误,能帮我找出来吗?
Data one;
Input rep sex$ @;
Do x=0.38, 0.42, 0.46, 0.50, 0.54, 0.58;
Input y @; output;
End;
datalines;
1 ba 533 686 819 757 691 667
2 ba 452 543 657 743 757 721
3 gi 433 648 561 560 657 651
4 gi 418 530 712 721 809 862
;
Proc print; run;
Data fill;
Do rep=1 to 4;
Do x=0.38 to 0.58 by 0.001; y=.; output; end; end; run;
Data one; set one fill; run;
***straight broken line with a random component included for parameter 1;
Proc nlmixed data=one maxiteR=1000;
Parameters L=725 U=130 R=0.5;
X1=(x<R)*(R-x);
Model y~normal (L+U*(z1)+lvar, errvar);
Random lvar~normal (0, repvar) subject= rep out=blups;
Predict L+U*(z1)+lvar out=ppp; run;
Ods output dimensions=ddd;
Data ppp; set ppp;
Resid=y-pred; run;
*****run this code to get an R-square and adjusted R-square;
Proc means noprint data=ppp; where y ne .;
Var y resid;
Output out =mmm uss=totss sserr css=ctotss rss1 n=nobs; run;
Data ddd; set ddd; if descr='prarameters'; run;
Proc sort data =blups; by effect;
Proc means noprint data=blups; by effect;
Var estimate;
Output out=nnn n=nlevels; run;
Proc means noprint;
Var nlevels;
Output out =nnn2 n=nrand sum=dfrand; run;
Data mmm; merge mmm ddd nnn2;
Rsquare=(ctotss-sserr)/ctotss;
Adjrsquare =1-(sserr/(nobs-value-dfrand+nrand-1))/(ctotss/(nobs-1));run; proc print; run;
*****run this code to get plot fitted model;
Proc sort data=ppp; by x;
Data predplot; set ppp;
If rep=1 then do; pred1=pred; y1=y; end;
If rep=2 then do; pred2=pred; y2=y; end;
If rep=3 then do; pred3=pred; y3=y; end;
If rep=4 then do; pred4=pred; y4=y; end;
Proc gplot data=predplot;
Title2 'straight broken line with lvar';
Goptions hpos=35 vpos=35 ftext=swiss;
Symbol1 v=dot c=black i=none;
Symbol2 v=square c=blue i=none;
Symbol3 v=triangle c=red i=none;
Symbol4 v=x c=green i=none;
Symbol5 i=join v=none c=black;
Symbol6 i=join v=none c=blue;
Symbol7 i=join v=none c=red;
Symbol8 i=join v=none c=green;
Plot (y1 y2 y3 y4)*x (pred1 pred2 pred3 pred4)*x/overlay;
Run;
****quadratic broken line with a random component included for parameter 1;
Proc nlmixed data=one maxiter=1000;
Parameters L=725 U=0.13 R=0.5;
Bounds 0.4<R<0.6;
Z1=(x<R)*(R-x);
Model y ~normal (L+U*(z1*z1)+lvar,errvar);
Random lvar~Normal (0, repvar) subject=rep out=blups;
Predict L+U*(z1*z1) +lvar out=ppp;
Ods output dimensions = ddd; run;
*****quadratic broken line, allowing parameter U (slope) to have random component;
Proc nlmixed data=one maxiter=1000;
Parameters L=725 U=-2000 R=0.5;
Bounds 0.4<R<0.54;
Z1=(x<R)*(R-x);
Model y ~normal (L+(U+Ur)*(z1*z1)+lvar, errvar);
Random Ur lvar~normal((0,0),(uvar,0, repvar)) subject=rep out=blups;
Predict L+(U+Ur)*(z1*z1)+lvar out=ppp;
Ods output dimensitons=ddd;
Run;
*****quadratic model without random (block) effects***
Proc nlmixed data=one maxieR=1000;
Prarmeters L716 U=-17500 R=0.5;
Bounds 0.4<x<0.6;
Z1=(x<R)*(R-x);
Model y ~normal (L+ U*(z1)*(z1),errvar);
Predict L+U*(z1)*(z1) out=ppp;
Run;
****run this cods to get an R-square with no random (block) effects in model;
Data ppp; set ppp;
Resid=y-pred; run;
Proc means noprint data=ppp; where y ne .;
Var y resid;
Output out =mm muss=totss sserr=ctotss rssl n=nobs; run;
Data ddd; set ddd; if descry='parameters'; run;
Data mmm; merge mmm ddd ;
Rsquare = 1- (sserr/(nobs-value-1))/(ctotss/(nobs-1)); run;
Proc print; run;
huadli
Proc nlmixed data=one maxiteR=1000;
Parameters L=725 U=130 R=0.5;
X1=(x<R)*(R-x);
~~~X1怎么没有在model中出现,是不是应该改为z1???
Model y~normal (L+U*(z1)+lvar, errvar);
~~~errvar怎么不给出初始值???
Random lvar~normal (0, repvar) subject= rep out=blups;
~~~~repvar是不是也应该给出初始值???
Predict L+U*(z1)+lvar out=ppp; run;
Ods output dimensions=ddd;
yeth
运行之后日志是这样的,我不懂编程,这只是一个老外的程序
NOTE: Copyright (c) 1999-2001 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0)
Licensed to QUEENSLAND UNIVERSITY OF TECHNOLOGY, Site 0039969016.
NOTE: This session is executing on the WIN_PRO platform.
NOTE: SAS initialization used:
real time 1.76 seconds
cpu time 0.59 seconds
1 Data one;
2 Input rep sex$ @;
3 Do x=0.38, 0.42, 0.46, 0.50, 0.54, 0.58;
4 Input y @; output;
5 End;
6 datalines;
NOTE: The data set WORK.ONE has 24 observations and 4 variables.
NOTE: DATA statement used:
real time 0.31 seconds
cpu time 0.03 seconds
11 ;
12 Proc print; run;
NOTE: There were 24 observations read from the data set WORK.ONE.
NOTE: PROCEDURE PRINT used:
real time 0.15 seconds
cpu time 0.01 seconds
13 Data fill;
14 Do rep=1 to 4;
15 Do x=0.38 to 0.58 by 0.001; y=.; output; end; end; run;
NOTE: The data set WORK.FILL has 804 observations and 3 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.00 seconds
16 Data one; set one fill; run;
NOTE: There were 24 observations read from the data set WORK.ONE.
NOTE: There were 804 observations read from the data set WORK.FILL.
NOTE: The data set WORK.ONE has 828 observations and 4 variables.
NOTE: DATA statement used:
real time 0.00 seconds
cpu time 0.00 seconds
17 ***straight broken line with a random component included for parameter 1;
18 Proc nlmixed data=one maxiteR=1000;
19 Parameters L=725 U=130 R=0.5;
20 X1=(x<R)*(R-x);
21 Model y~normal (L+U*(z1)+lvar, errvar);
22 Random lvar~normal (0, repvar) subject= rep out=blups;
23 Predict L+U*(z1)+lvar out=ppp; run;
ERROR: QUANEW Optimization cannot be completed.
WARNING: Optimization routine cannot improve the function value.
NOTE: The data set WORK.BLUPS has 0 observations and 0 variables.
NOTE: The data set WORK.PPP has 0 observations and 0 variables.
NOTE: PROCEDURE NLMIXED used:
real time 0.73 seconds
cpu time 0.26 seconds
24 Ods output dimensions=ddd;
25 Data ppp; set ppp;
26 Resid=y-pred; run;
NOTE: Variable pred is uninitialized.
NOTE: Variable y is uninitialized.
NOTE: There were 0 observations read from the data set WORK.PPP.
NOTE: The data set WORK.PPP has 0 observations and 3 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.00 seconds
27
28 *****run this code to get an R-square and adjusted R-square;
29 Proc means noprint data=ppp; where y ne .;
30 Var y resid;
31 Output out =mmm uss=totss sserr css=ctotss rss1 n=nobs; run;
NOTE: No observations in data set WORK.PPP.
NOTE: The data set WORK.MMM has 0 observations and 7 variables.
NOTE: PROCEDURE MEANS used:
real time 0.04 seconds
cpu time 0.00 seconds
WARNING: Output 'dimensions' was not created.
32 Data ddd; set ddd; if descr='prarameters'; run;
ERROR: File WORK.DDD.DATA does not exist.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DDD may be incomplete. When this step was stopped there were 0
observations and 1 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
33 Proc sort data =blups; by effect;
ERROR: Variable EFFECT not found.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SORT used:
real time 0.03 seconds
cpu time 0.00 seconds
34 Proc means noprint data=blups; by effect;
ERROR: Variable EFFECT not found.
35 Var estimate;
ERROR: Variable ESTIMATE not found.
36 Output out=nnn n=nlevels; run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.NNN may be incomplete. When this step was stopped there were 0
observations and 0 variables.
NOTE: PROCEDURE MEANS used:
real time 0.01 seconds
cpu time 0.01 seconds
37 Proc means noprint;
38 Var nlevels;
ERROR: Variable NLEVELS not found.
39 Output out =nnn2 n=nrand sum=dfrand; run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.NNN2 may be incomplete. When this step was stopped there were 0
observations and 0 variables.
NOTE: PROCEDURE MEANS used:
real time 0.01 seconds
cpu time 0.01 seconds
40 Data mmm; merge mmm ddd nnn2;
41 Rsquare=(ctotss-sserr)/ctotss;
42 Adjrsquare =1-(sserr/(nobs-value-dfrand+nrand-1))/(ctotss/(nobs-1));run;
NOTE: Variable value is uninitialized.
NOTE: Variable dfrand is uninitialized.
NOTE: Variable nrand is uninitialized.
NOTE: There were 0 observations read from the data set WORK.MMM.
NOTE: There were 0 observations read from the data set WORK.DDD.
NOTE: There were 0 observations read from the data set WORK.NNN2.
NOTE: The data set WORK.MMM has 0 observations and 13 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
42 ! proc print; run;
NOTE: No observations in data set WORK.MMM.
NOTE: PROCEDURE PRINT used:
real time 0.00 seconds
cpu time 0.00 seconds
43
44
45
46 *****run this code to get plot fitted model;
47
48 Proc sort data=ppp; by x;
ERROR: Variable X not found.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SORT used:
real time 0.01 seconds
cpu time 0.01 seconds
49 Data predplot; set ppp;
50 If rep=1 then do; pred1=pred; y1=y; end;
51 If rep=2 then do; pred2=pred; y2=y; end;
52 If rep=3 then do; pred3=pred; y3=y; end;
53 If rep=4 then do; pred4=pred; y4=y; end;
NOTE: Variable rep is uninitialized.
NOTE: There were 0 observations read from the data set WORK.PPP.
NOTE: The data set WORK.PREDPLOT has 0 observations and 12 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
54 Proc gplot data=predplot;
55 Title2 'straight broken line with lvar';
56 Goptions hpos=35 vpos=35 ftext=swiss;
57 Symbol1 v=dot c=black i=none;
58 Symbol2 v=square c=blue i=none;
59 Symbol3 v=triangle c=red i=none;
60 Symbol4 v=x c=green i=none;
61 Symbol5 i=join v=none c=black;
62 Symbol6 i=join v=none c=blue;
63 Symbol7 i=join v=none c=red;
64 Symbol8 i=join v=none c=green;
65 Plot (y1 y2 y3 y4)*x (pred1 pred2 pred3 pred4)*x/overlay;
ERROR: Variable X not found.
ERROR: Variable X not found.
NOTE: The previous statement has been deleted.
66 Run;
NOTE: No observations in data set WORK.PREDPLOT.
67
68
69
70 ****quadratic broken line with a random component included for parameter 1;
71
NOTE: PROCEDURE GPLOT used:
real time 0.29 seconds
cpu time 0.01 seconds
72 Proc nlmixed data=one maxiter=1000;
73 Parameters L=725 U=0.13 R=0.5;
74 Bounds 0.4<R<0.6;
75 Z1=(x<R)*(R-x);
76 Model y ~normal (L+U*(z1*z1)+lvar,errvar);
77 Random lvar~Normal (0, repvar) subject=rep out=blups;
78 Predict L+U*(z1*z1) +lvar out=ppp;
79 Ods output dimensions = ddd; run;
NOTE: GCONV convergence criterion satisfied.
NOTE: At least one element of the (projected) gradient is greater than 1e-3.
NOTE: Moore-Penrose inverse is used in covariance matrix.
WARNING: The final Hessian matrix is not positive definite, and therefore the estimated covariance
matrix is not full rank and may be unreliable. The variance of some parameter estimates
is zero or some parameters are linearly related to other parameters.
NOTE: The data set WORK.DDD has 7 observations and 2 variables.
NOTE: The data set WORK.BLUPS has 8 observations and 10 variables.
NOTE: The data set WORK.PPP has 828 observations and 12 variables.
NOTE: PROCEDURE NLMIXED used:
real time 0.29 seconds
cpu time 0.10 seconds
80
81 *****quadratic broken line, allowing parameter U (slope) to have random component;
82
83 Proc nlmixed data=one maxiter=1000;
84 Parameters L=725 U=-2000 R=0.5;
85 Bounds 0.4<R<0.54;
86 Z1=(x<R)*(R-x);
87 Model y ~normal (L+(U+Ur)*(z1*z1)+lvar, errvar);
NOTE: SCL source line.
88 Random Ur lvar~normal((0,0),(uvar,0, repvar)) subject=rep out=blups;
-
79
ERROR 79-322: Expecting a ).
-
76
ERROR 76-322: Syntax error, statement will be ignored.
88 ! Random Ur lvar~normal((0,0),(uvar,0, repvar)) subject=rep out=blups;
-
79
ERROR 79-322: Expecting a SUBJECT.
89 Predict L+(U+Ur)*(z1*z1)+lvar out=ppp;
90 Ods output dimensitons=ddd;
91 Run;
NOTE: The data set WORK.PPP has 0 observations and 0 variables.
WARNING: Data set WORK.PPP was not replaced because new file is incomplete.
NOTE: PROCEDURE NLMIXED used:
real time 0.04 seconds
cpu time 0.01 seconds
WARNING: Output 'dimensitons' was not created.
92
93
94 *****quadratic model without random (block) effects***
95 Proc nlmixed data=one maxieR=1000;
NOTE: SCL source line.
96 Prarmeters L716 U=-17500 R=0.5;
----------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: SCL source line.
97 Bounds 0.4<x<0.6;
------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: SCL source line.
98 Z1=(x<R)*(R-x);
--
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: SCL source line.
99 Model y ~normal (L+ U*(z1)*(z1),errvar);
-----
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: SCL source line.
100 Predict L+U*(z1)*(z1) out=ppp;
-------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
101 Run;
102
103
104 ****run this cods to get an R-square with no random (block) effects in model;
105 Data ppp; set ppp;
106 Resid=y-pred; run;
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
804 at 106:8
NOTE: There were 828 observations read from the data set WORK.PPP.
NOTE: The data set WORK.PPP has 828 observations and 13 variables.
NOTE: DATA statement used:
real time 0.03 seconds
cpu time 0.01 seconds
107 Proc means noprint data=ppp; where y ne .;
108 Var y resid;
NOTE: SCL source line.
109 Output out =mm muss=totss sserr=ctotss rssl n=nobs; run;
----
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, (, /, CSS, CV, IDGROUP, IDGRP,
KURTOSIS, LCLM, MAX, MAXID, MEAN, MEDIAN, MIN, MINID, N, NMISS, OUT, P1, P10, P25,
P5, P50, P75, P90, P95, P99, PROBT, Q1, Q3, QRANGE, RANGE, SKEWNESS, STDDEV, STDERR,
SUM, SUMWGT, T, UCLM, USS, VAR.
ERROR 76-322: Syntax error, statement will be ignored.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MEANS used:
real time 0.03 seconds
cpu time 0.00 seconds
110 Data ddd; set ddd; if descry='parameters'; run;
NOTE: Variable descry is uninitialized.
NOTE: There were 7 observations read from the data set WORK.DDD.
NOTE: The data set WORK.DDD has 0 observations and 3 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
111 Data mmm; merge mmm ddd ;
112 Rsquare = 1- (sserr/(nobs-value-1))/(ctotss/(nobs-1)); run;
NOTE: There were 0 observations read from the data set WORK.MMM.
NOTE: There were 0 observations read from the data set WORK.DDD.
NOTE: The data set WORK.MMM has 0 observations and 14 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
113 Proc print; run;
NOTE: No observations in data set WORK.MMM.
NOTE: PROCEDURE PRINT used:
real time 0.01 seconds
cpu time 0.01 seconds
yeth
是不是我版本太低了,这个是用9.0编的。
老外不会骗人的,可以信赖。
yeth
输出结果是这样的
NOTE: Copyright (c) 1999-2001 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0)
Licensed to QUEENSLAND UNIVERSITY OF TECHNOLOGY, Site 0039969016.
NOTE: This session is executing on the WIN_PRO platform.
NOTE: SAS initialization used:
real time 1.76 seconds
cpu time 0.59 seconds
1 Data one;
2 Input rep sex$ @;
3 Do x=0.38, 0.42, 0.46, 0.50, 0.54, 0.58;
4 Input y @; output;
5 End;
6 datalines;
NOTE: The data set WORK.ONE has 24 observations and 4 variables.
NOTE: DATA statement used:
real time 0.31 seconds
cpu time 0.03 seconds
11 ;
12 Proc print; run;
NOTE: There were 24 observations read from the data set WORK.ONE.
NOTE: PROCEDURE PRINT used:
real time 0.15 seconds
cpu time 0.01 seconds
13 Data fill;
14 Do rep=1 to 4;
15 Do x=0.38 to 0.58 by 0.001; y=.; output; end; end; run;
NOTE: The data set WORK.FILL has 804 observations and 3 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.00 seconds
16 Data one; set one fill; run;
NOTE: There were 24 observations read from the data set WORK.ONE.
NOTE: There were 804 observations read from the data set WORK.FILL.
NOTE: The data set WORK.ONE has 828 observations and 4 variables.
NOTE: DATA statement used:
real time 0.00 seconds
cpu time 0.00 seconds
17 ***straight broken line with a random component included for parameter 1;
18 Proc nlmixed data=one maxiteR=1000;
19 Parameters L=725 U=130 R=0.5;
20 X1=(x<R)*(R-x);
21 Model y~normal (L+U*(z1)+lvar, errvar);
22 Random lvar~normal (0, repvar) subject= rep out=blups;
23 Predict L+U*(z1)+lvar out=ppp; run;
ERROR: QUANEW Optimization cannot be completed.
WARNING: Optimization routine cannot improve the function value.
NOTE: The data set WORK.BLUPS has 0 observations and 0 variables.
NOTE: The data set WORK.PPP has 0 observations and 0 variables.
NOTE: PROCEDURE NLMIXED used:
real time 0.73 seconds
cpu time 0.26 seconds
24 Ods output dimensions=ddd;
25 Data ppp; set ppp;
26 Resid=y-pred; run;
NOTE: Variable pred is uninitialized.
NOTE: Variable y is uninitialized.
NOTE: There were 0 observations read from the data set WORK.PPP.
NOTE: The data set WORK.PPP has 0 observations and 3 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.00 seconds
27
28 *****run this code to get an R-square and adjusted R-square;
29 Proc means noprint data=ppp; where y ne .;
30 Var y resid;
31 Output out =mmm uss=totss sserr css=ctotss rss1 n=nobs; run;
NOTE: No observations in data set WORK.PPP.
NOTE: The data set WORK.MMM has 0 observations and 7 variables.
NOTE: PROCEDURE MEANS used:
real time 0.04 seconds
cpu time 0.00 seconds
WARNING: Output 'dimensions' was not created.
32 Data ddd; set ddd; if descr='prarameters'; run;
ERROR: File WORK.DDD.DATA does not exist.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DDD may be incomplete. When this step was stopped there were 0
observations and 1 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
33 Proc sort data =blups; by effect;
ERROR: Variable EFFECT not found.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SORT used:
real time 0.03 seconds
cpu time 0.00 seconds
34 Proc means noprint data=blups; by effect;
ERROR: Variable EFFECT not found.
35 Var estimate;
ERROR: Variable ESTIMATE not found.
36 Output out=nnn n=nlevels; run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.NNN may be incomplete. When this step was stopped there were 0
observations and 0 variables.
NOTE: PROCEDURE MEANS used:
real time 0.01 seconds
cpu time 0.01 seconds
37 Proc means noprint;
38 Var nlevels;
ERROR: Variable NLEVELS not found.
39 Output out =nnn2 n=nrand sum=dfrand; run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.NNN2 may be incomplete. When this step was stopped there were 0
observations and 0 variables.
NOTE: PROCEDURE MEANS used:
real time 0.01 seconds
cpu time 0.01 seconds
40 Data mmm; merge mmm ddd nnn2;
41 Rsquare=(ctotss-sserr)/ctotss;
42 Adjrsquare =1-(sserr/(nobs-value-dfrand+nrand-1))/(ctotss/(nobs-1));run;
NOTE: Variable value is uninitialized.
NOTE: Variable dfrand is uninitialized.
NOTE: Variable nrand is uninitialized.
NOTE: There were 0 observations read from the data set WORK.MMM.
NOTE: There were 0 observations read from the data set WORK.DDD.
NOTE: There were 0 observations read from the data set WORK.NNN2.
NOTE: The data set WORK.MMM has 0 observations and 13 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
42 ! proc print; run;
NOTE: No observations in data set WORK.MMM.
NOTE: PROCEDURE PRINT used:
real time 0.00 seconds
cpu time 0.00 seconds
43
44
45
46 *****run this code to get plot fitted model;
47
48 Proc sort data=ppp; by x;
ERROR: Variable X not found.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SORT used:
real time 0.01 seconds
cpu time 0.01 seconds
49 Data predplot; set ppp;
50 If rep=1 then do; pred1=pred; y1=y; end;
51 If rep=2 then do; pred2=pred; y2=y; end;
52 If rep=3 then do; pred3=pred; y3=y; end;
53 If rep=4 then do; pred4=pred; y4=y; end;
NOTE: Variable rep is uninitialized.
NOTE: There were 0 observations read from the data set WORK.PPP.
NOTE: The data set WORK.PREDPLOT has 0 observations and 12 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
54 Proc gplot data=predplot;
55 Title2 'straight broken line with lvar';
56 Goptions hpos=35 vpos=35 ftext=swiss;
57 Symbol1 v=dot c=black i=none;
58 Symbol2 v=square c=blue i=none;
59 Symbol3 v=triangle c=red i=none;
60 Symbol4 v=x c=green i=none;
61 Symbol5 i=join v=none c=black;
62 Symbol6 i=join v=none c=blue;
63 Symbol7 i=join v=none c=red;
64 Symbol8 i=join v=none c=green;
65 Plot (y1 y2 y3 y4)*x (pred1 pred2 pred3 pred4)*x/overlay;
ERROR: Variable X not found.
ERROR: Variable X not found.
NOTE: The previous statement has been deleted.
66 Run;
NOTE: No observations in data set WORK.PREDPLOT.
67
68
69
70 ****quadratic broken line with a random component included for parameter 1;
71
NOTE: PROCEDURE GPLOT used:
real time 0.29 seconds
cpu time 0.01 seconds
72 Proc nlmixed data=one maxiter=1000;
73 Parameters L=725 U=0.13 R=0.5;
74 Bounds 0.4<R<0.6;
75 Z1=(x<R)*(R-x);
76 Model y ~normal (L+U*(z1*z1)+lvar,errvar);
77 Random lvar~Normal (0, repvar) subject=rep out=blups;
78 Predict L+U*(z1*z1) +lvar out=ppp;
79 Ods output dimensions = ddd; run;
NOTE: GCONV convergence criterion satisfied.
NOTE: At least one element of the (projected) gradient is greater than 1e-3.
NOTE: Moore-Penrose inverse is used in covariance matrix.
WARNING: The final Hessian matrix is not positive definite, and therefore the estimated covariance
matrix is not full rank and may be unreliable. The variance of some parameter estimates
is zero or some parameters are linearly related to other parameters.
NOTE: The data set WORK.DDD has 7 observations and 2 variables.
NOTE: The data set WORK.BLUPS has 8 observations and 10 variables.
NOTE: The data set WORK.PPP has 828 observations and 12 variables.
NOTE: PROCEDURE NLMIXED used:
real time 0.29 seconds
cpu time 0.10 seconds
80
81 *****quadratic broken line, allowing parameter U (slope) to have random component;
82
83 Proc nlmixed data=one maxiter=1000;
84 Parameters L=725 U=-2000 R=0.5;
85 Bounds 0.4<R<0.54;
86 Z1=(x<R)*(R-x);
87 Model y ~normal (L+(U+Ur)*(z1*z1)+lvar, errvar);
NOTE: SCL source line.
88 Random Ur lvar~normal((0,0),(uvar,0, repvar)) subject=rep out=blups;
-
79
ERROR 79-322: Expecting a ).
-
76
ERROR 76-322: Syntax error, statement will be ignored.
88 ! Random Ur lvar~normal((0,0),(uvar,0, repvar)) subject=rep out=blups;
-
79
ERROR 79-322: Expecting a SUBJECT.
89 Predict L+(U+Ur)*(z1*z1)+lvar out=ppp;
90 Ods output dimensitons=ddd;
91 Run;
NOTE: The data set WORK.PPP has 0 observations and 0 variables.
WARNING: Data set WORK.PPP was not replaced because new file is incomplete.
NOTE: PROCEDURE NLMIXED used:
real time 0.04 seconds
cpu time 0.01 seconds
WARNING: Output 'dimensitons' was not created.
92
93
94 *****quadratic model without random (block) effects***
95 Proc nlmixed data=one maxieR=1000;
NOTE: SCL source line.
96 Prarmeters L716 U=-17500 R=0.5;
----------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: SCL source line.
97 Bounds 0.4<x<0.6;
------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: SCL source line.
98 Z1=(x<R)*(R-x);
--
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: SCL source line.
99 Model y ~normal (L+ U*(z1)*(z1),errvar);
-----
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
NOTE: SCL source line.
100 Predict L+U*(z1)*(z1) out=ppp;
-------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
101 Run;
102
103
104 ****run this cods to get an R-square with no random (block) effects in model;
105 Data ppp; set ppp;
106 Resid=y-pred; run;
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
804 at 106:8
NOTE: There were 828 observations read from the data set WORK.PPP.
NOTE: The data set WORK.PPP has 828 observations and 13 variables.
NOTE: DATA statement used:
real time 0.03 seconds
cpu time 0.01 seconds
107 Proc means noprint data=ppp; where y ne .;
108 Var y resid;
NOTE: SCL source line.
109 Output out =mm muss=totss sserr=ctotss rssl n=nobs; run;
----
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, (, /, CSS, CV, IDGROUP, IDGRP,
KURTOSIS, LCLM, MAX, MAXID, MEAN, MEDIAN, MIN, MINID, N, NMISS, OUT, P1, P10, P25,
P5, P50, P75, P90, P95, P99, PROBT, Q1, Q3, QRANGE, RANGE, SKEWNESS, STDDEV, STDERR,
SUM, SUMWGT, T, UCLM, USS, VAR.
ERROR 76-322: Syntax error, statement will be ignored.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MEANS used:
real time 0.03 seconds
cpu time 0.00 seconds
110 Data ddd; set ddd; if descry='parameters'; run;
NOTE: Variable descry is uninitialized.
NOTE: There were 7 observations read from the data set WORK.DDD.
NOTE: The data set WORK.DDD has 0 observations and 3 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
111 Data mmm; merge mmm ddd ;
112 Rsquare = 1- (sserr/(nobs-value-1))/(ctotss/(nobs-1)); run;
NOTE: There were 0 observations read from the data set WORK.MMM.
NOTE: There were 0 observations read from the data set WORK.DDD.
NOTE: The data set WORK.MMM has 0 observations and 14 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.01 seconds
113 Proc print; run;
NOTE: No observations in data set WORK.MMM.
NOTE: PROCEDURE PRINT used:
real time 0.01 seconds
cpu time 0.01 seconds
huadli
你的程序的几个错误
1.***straight broken line with a random component included for parameter 1;
Proc nlmixed data=one maxiteR=1000;
Parameters L=725 U=130 R=0.5;
X1=(x<R)*(R-x);
~~~改为Z1
Model y~normal (L+U*(z1)+lvar, errvar);
Random lvar~normal (0, repvar) subject= rep out=blups;
Ods output dimensions=ddd;
~~~ods 应该在Run前面。
Predict L+U*(z1)+lvar out=ppp; run;
2.*****quadratic broken line, allowing parameter U (slope) to have random component;
Proc nlmixed data=one maxiter=1000;
Parameters L=725 U=-2000 R=0.5;
Bounds 0.4<R<0.54;
Z1=(x<R)*(R-x);
Model y ~normal (L+(U+Ur)*(z1*z1)+lvar, errvar);
Random Ur lvar~normal([0,0],[uvar,0, repvar])subject=rep out=blups;
~~~() 改为[]
Predict L+(U+Ur)*(z1*z1)+lvar out=ppp;
Ods output dimensitons=ddd;
Run;
3.
*****quadratic model without random (block) effects***
Proc nlmixed data=one maxieR=1000;
Prarmeters L716 U=-17500 R=0.5;
~~单词写错了 应改为Parameters。
Bounds 0.4<x<0.6;
~~x改为R
Z1=(x<R)*(R-x);
Model y ~normal (L+ U*(z1)*(z1),errvar);
Predict L+U*(z1)*(z1) out=ppp;
Run;
4.
****run this cods to get an R-square with no random (block) effects in model;
Data ppp; set ppp;
Resid=y-pred; run;
Proc means noprint data=ppp; where y ne .;
Var y resid;
Output out =mmm uss=totss sserr=ctotss rssl n=nobs; run;
~~~ m是前面的
Data ddd; set ddd; if descry='parameters'; run;
Data mmm; merge mmm ddd ;
Rsquare = 1- (sserr/(nobs-value-1))/(ctotss/(nobs-1)); run;
Proc print; run;
huadli
这个非线性混合效应模型也有问题,sas警告Hessian matrix为非正定的
hexm26
[quote]引用第3楼yeth于2007-08-23 11:32发表的“”:
是不是我版本太低了,这个是用9.0编的。
老外不会骗人的,可以信赖。[/quote]
老外不会骗人的,可以信赖。
~~~~~~~~~~~~~~~~呵呵,这个结论从何而来?
yeth
谢谢各位。
yeth
呵呵,那个老外不会开这种玩笑的。影响会很大。不是所有老外和老外的所有行为都是值得信任的。还是感谢各位。
rtist
[quote]引用第9楼yeth于2007-08-27 23:59发表的“”:
呵呵,那个老外不会开这种玩笑的。影响会很大。不是所有老外和老外的所有行为都是值得信任的。还是感谢各位。[/quote]
问题是bug通常都不是开玩笑而故意写进去的。
如果认为老外的写得程序都可信,xp也不会有这么多补丁了。
短的还好说,太长的没人能保证bug-free。
没注意到软件都有免责声明么?就是说如果软件有什么问题,开发者/发行者不承担任何责任。