Blog Archives

The distribution of colors for plain M&M candies

February 20, 2017
By
The distribution of colors for plain M&M candies

Many introductory courses in probability and statistics encourage students to collect and analyze real data. A popular experiment in categorical data analysis is to give students a bag of M&M® candies and ask them to estimate the proportion of colors in the population from the sample data. In some classes, [...] The post The distribution of colors for plain M&M candies appeared first on The DO Loop.

Read more »

Simultaneous confidence intervals for multinomial proportions

February 15, 2017
By
Simultaneous confidence intervals for multinomial proportions

A categorical response variable can take on k different values. If you have a random sample from a multinomial response, the sample proportions estimate the proportion of each category in the population. This article describes how to construct simultaneous confidence intervals for the proportions as described in the 1997 paper [...] The post Simultaneous confidence intervals for multinomial proportions appeared first on The DO Loop.

Read more »

An easy way to run thousands of regressions in SAS

February 13, 2017
By
An easy way to run thousands of regressions in SAS

A common question on SAS discussion forums is how to repeat an analysis multiple times. Most programmers know that the most efficient way to analyze one model across many subsets of the data (perhaps each country or each state) is to sort the data and use a BY statement to [...] The post An easy way to run thousands of regressions in SAS appeared first on The DO Loop.

Read more »

Winsorization: The good, the bad, and the ugly

February 8, 2017
By
Winsorization: The good, the bad, and the ugly

On discussion forums, I often see questions that ask how to Winsorize variables in SAS. For example, here are some typical questions from the SAS Support Community: I want an efficient way of replacing (upper) extreme values with (95th) percentile. I have a data set with around 600 variables and [...] The post Winsorization: The good, the bad, and the ugly appeared first on The DO Loop.

Read more »

What colors does PROC SGPLOT use for markers?

February 6, 2017
By
What colors does PROC SGPLOT use for markers?

Suppose you create a scatter plot in SAS with PROC SGPLOT. What color does PROC SGPLOT use for the markers? If you specify the GROUP= option so that markers are colored by a grouping variable, what colors are used to represent the various groups? The following scatter plot shows the [...] The post What colors does PROC SGPLOT use for markers? appeared first on The DO Loop.

Read more »

Simulate many samples from a linear regression model

February 1, 2017
By
Simulate many samples from a linear regression model

In a previous article, I showed how to simulate data for a linear regression model with an arbitrary number of continuous explanatory variables. To keep the discussion simple, I simulated a single sample with N observations and p variables. However, to use Monte Carlo methods to approximate the sampling distribution [...] The post Simulate many samples from a linear regression model appeared first on The DO Loop.

Read more »

Automate the creation of a discrete attribute map

January 30, 2017
By
Automate the creation of a discrete attribute map

If you are a SAS programmer and use the GROUP= option in PROC SGPLOT, you might have encountered a thorny issue: if you use a WHERE clause to omit certain observations, then the marker colors for groups might change from one plot to another. This happens because the marker colors [...] The post Automate the creation of a discrete attribute map appeared first on The DO Loop.

Read more »

Simulate data for a linear regression model

January 25, 2017
By
Simulate data for a linear regression model

This article shows how to simulate a data set in SAS that satisfies a least squares regression model for continuous variables. When you simulate to create "synthetic" (or "fake") data, you (the programmer) control the true parameter values, the form of the model, the sample size, and magnitude of the [...] The post Simulate data for a linear regression model appeared first on The DO Loop.

Read more »

Five reasons to check out the new SAS analytical documentation

January 23, 2017
By
Five reasons to check out the new SAS analytical documentation

The SAS analytical documentation has a new look. Beginning with the 14.2 release of the SAS analytical products (which shipped with SAS 9.4m4 in November 2016), the HTML version of the online documentation has moved to a new framework called the Help Center. The URL for the online documentation is [...] The post Five reasons to check out the new SAS analytical documentation appeared first on The DO Loop.

Read more »

Solve mixed integer linear programming problems in SAS

January 18, 2017
By
Solve mixed integer linear programming problems in SAS

This article shows how to solve mixed integer linear programming (MILP) problems in SAS. In a mixed integer problem, some of the variables in the problem are integer-valued whereas others are continuous. The objective function is a linear function of the variables and the variables can be subject to linear [...] The post Solve mixed integer linear programming problems in SAS appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe