Nonlinear Models
Learning Example: knnl533.sas Y = relative efficiency of production of a new product (1/expected cost) X 1 : Location A : X 1 = 1, B: X 1 = 0 X 2 = time (weeks) n = 30
Learning Example: input data learning; infile 'I:\My Documents\Stat 512\CH13TA04.DAT'; input x1 x2 y; label x1 = 'Location' x2 = 'Week' y = 'Efficiency'; proc print data = ch13tab04; run; Obsx1x2y ⁞⁞⁞⁞
Learning Example: Interaction plot title1 'Plot of the data'; symbol1 v = ‘B' i = none c = blue; symbol2 v = ’A' i = none c = red; proc gplot data = learning; plot y*x2 = x1; run;
Learning Example: Interaction plot (cont)
Learning Example: Model proc nlin data = learning method = newton; parms g0=1.025 g1= g2=-0.5 g3= ; model y = g0 + g1*x1 + g2*exp(g3*x2); output out = nlinout p = pred; run; The NLIN Procedure Dependent Variable y Method: Newton Iterative Phase Iterg0g1g2g3Sum of Squares NOTE: Convergence criterion met.
Learning Example: Results SourceDFSum of SquaresMean SquareF Value Approx Pr > F Model <.0001 Error Corrected Total ParameterEstimate Approx Std Error Approximate 95% Confidence Limits g g g g
Learning Example: Results (cont) Approximate Correlation Matrix g0g1g2g3 g g g g
Learning Example: Fitted Data data nlinout; set nlinout; if x1 = 0 then do; y1 = y; z21 = x2; p1 = pred; end; if x1 = 1 then do; y2 = y; z22 = x2; p2 = pred; end; run; symbol1 v = 'B' i = none c = blue; symbol2 v = 'A' i = none c = red; symbol3 v = none i = join c = blue; symbol4 v = none i = join c = red; proc gplot data = nlinout; plot y1*z21 y2*z22 p1*z21 p2*z22/overlay; run;
Learning Example: Fitted Data (cont)