Functions and CALL Routines 
Category:  Descriptive Statistics 
Syntax  
Arguments  
Details  
Examples  
Example 1: Calculating the Lp Norm  
Example 2: Calculating the Lp Norm When You Use a Variable List  
See Also 
Syntax 
LPNORM(p, value1 <,value2 ...>) 
specifies a numeric constant, variable, or expression that is greater than or equal to 1, which is used as the power for computing the L_{p} norm.
specifies a numeric constant, variable, or expression.
Details 
If all arguments have missing values, then the result is a missing value. Otherwise, the result is the L_{p} norm of the nonmissing values of the second and subsequent arguments.
In the following example, p is the value of the first argument, and are the values of the other nonmissing arguments.
Examples 
The following example returns the L_{p} norm of the second and subsequent nonmissing arguments.
data _null_; x1 = lpnorm(1, ., 3, 0, .q, 4); x2 = lpnorm(2, ., 3, 0, .q, 4); x3 = lpnorm(3, ., 3, 0, .q, 4); x999 = lpnorm(999, ., 3, 0, .q, 4); put x1= / x2= / x3= / x999=; run;
SAS writes the following output to the log:
x1=7 x2=5 x3=4.4979414453 x999=4
The following example uses a variable list and returns the L_{p} norm.
data _null_; x1 = 1; x2 = 3; x3 = 4; x4 = 3; x5 = 1; x = lpnorm(of x1x5); put x=; run;
SAS writes the following output to the log:
x=11
See Also 
Functions:

Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.