In his book, Rudolf Freund described a confounding phenomenon while fitting a linear regression. Given a small data set below, there are three variables – dependent variable(y) and independent variables(x1 and x2). Using x2 to fit y alone, the estimat…
Example 9.24: Changing the parameterization for categorical predictors
In our book, we discuss the important question of how to assign different parameterizations to categorical variables when fitting models (section 3.1.3). We show code in R for use in the lm() function, as follows:lm(y ~ x, contrasts=list(x,”contr.trea…
MDX: Dynamically Hiding Measures for Compliance
OLAP cubes are great for summarizing data very fast – I love them . In certain environments, HIPAA compliance for personally identifiable data might be a concern. Even at the lowest grain of a cube it might be possible to identify the specific detail data beneath the surface if the summarized number is small enough. For example, if a report shows the number of people that work for a company in a county of a state that are over the age of 50 – it may be beneficial to hide the statistic to protect the identity of that sample size. Using MDX logic, we can dynamically hide measures that meet a certain criteria. In the MDX code below, I have added an additional measure to the OLAP cube I used for SAS Global forum in 2011. It will aggregate the Total Sales measure like normal but if the Total Sales measure is less than 50,000 it will show nothing. DEFINE Member “[SGF2011].[Measures].[Restricted Total Sales]” AS ‘iif([Measures].[Total Sales]<50000,NULL,[Measures].[Total Sales]),FORMAT_STRING = “DOLLAR20.0″‘; The Enterprise Guide screenshot to the right shows the output! Secure the Original Measure with Metadata Permissions One concept I always promote with writing MDX code is […]
Implement BY processing for your entire SAS program
Most SAS procedures support the BY statement, which allows you to create a report or analysis for each distinct value of a variable in your data set. The syntax is simple, and SAS procedures are usually tuned to do a good job of processing the data efficiently. However, the BY […]
Why is there only one subject in my mixed model?
This morning I had to send my watch off to Switzerland to have its guts replaced. I will be late to everything for the next two weeks. So it was timely that when I got to work, my inbox had the following question from a former student in the Mixed Mod…
SAS Office Analytics – my own personal “easy button”
Before new courses are presented to the public, we have internal ‘test teaches’ giving SAS employees the opportunity to attend new courses and give feedback to the course developers on how to make the course top quality for our customers. A few w…