Hi
I'm trying to calculate outliners within a datset trying:
proc sql;
SELECT
CASE
WHEN a.row_num <= ceil(0.25 * b.total_rows) THEN 1
WHEN a.row_num <= ceil(0.5 * b.total_rows) THEN 2
WHEN a.row_num <= ceil(0.75 * b.total_rows) THEN 3
ELSE 4
END AS quartile,
AVG(a.value) AS quartile_value
FROM
(SELECT value, row_num() AS row_num FROM MYDATASET) AS a
INNER JOIN
(SELECT count(*) AS total_rows FROM MYDATASET) AS b
ON
1=1
GROUP BY
quartile;
quit;
My dataset have three col=sector (char), country (char), value (num)
ERROR: Function ROW_NUM could not be located.
ERROR: Expression using less than or equal (<=) has components that are of different data
types.
ERROR: Expression using less than or equal (<=) has components that are of different data
types.
ERROR: Expression using less than or equal (<=) has components that are of different data
types.
1451 quit;
I can't use OVER or HAVING or such beacuse of my version of my computer,