Blog Archives

The jackknife method to estimate standard errors in SAS

June 21, 2017
By
The jackknife method to estimate standard errors in SAS

One way to assess the precision of a statistic (a point estimate) is to compute the standard error, which is the standard deviation of the statistic's sampling distribution. A relatively large standard error indicates that the point estimate should be viewed with skepticism, either because the sample size is small [...] The post The jackknife method to estimate standard errors in SAS appeared first on The DO Loop.

Read more »

How to find a feasible point for a constrained optimization in SAS

June 19, 2017
By
How to find a feasible point for a constrained optimization in SAS

Most numerical optimization routines require that the user provide an initial guess for the solution. I have previously described a method for choosing an initial guess for an optimization, which works well for low-dimensional optimization problems. Recently a SAS programmer asked how to find an initial guess when there are [...] The post How to find a feasible point for a constrained optimization in SAS appeared first on The DO…

Read more »

Two ways to compute maximum likelihood estimates in SAS

June 14, 2017
By
Two ways to compute maximum likelihood estimates in SAS

In a previous article, I showed two ways to define a log-likelihood function in SAS. This article shows two ways to compute maximum likelihood estimates (MLEs) in SAS: the nonlinear optimization subroutines in SAS/IML and the NLMIXED procedure in SAS/STAT. To illustrate these methods, I will use the same data [...] The post Two ways to compute maximum likelihood estimates in SAS appeared first on The DO Loop.

Read more »

Two simple ways to construct a log-likelihood function in SAS

June 12, 2017
By
Two simple ways to construct a log-likelihood function in SAS

Maximum likelihood estimation (MLE) is a powerful statistical technique that uses optimization techniques to fit parametric models. The technique finds the parameters that are "most likely" to have produced the observed data. SAS provides many tools for nonlinear optimization, so often the hardest part of maximum likelihood is writing down [...] The post Two simple ways to construct a log-likelihood function in SAS appeared first on The DO Loop.

Read more »

The IFN function versus the IF-THEN/ELSE statement in SAS

June 7, 2017
By
The IFN function versus the IF-THEN/ELSE statement in SAS

I have previously discussed how to define functions that safely evaluate their arguments and return a missing value if the argument is not in the domain of the function. The canonical example is the LOG function, which is defined only for positive arguments. For example, to evaluate the LOG function [...] The post The IFN function versus the IF-THEN/ELSE statement in SAS appeared first on The DO Loop.

Read more »

Runs in coin tosses; patterns in random seating

June 5, 2017
By
Runs in coin tosses; patterns in random seating

If you toss a coin 28 times, you would not be surprised to see three heads in a row, such as ...THHHTH.... But what about eight heads in a row? Would a sequence such as THHHHHHHHTH... be a rare event? This question popped into my head last weekend as I [...] The post Runs in coin tosses; patterns in random seating appeared first on The DO Loop.

Read more »

How to choose a seed for generating random numbers in SAS

June 1, 2017
By
How to choose a seed for generating random numbers in SAS

Last week I was asked a simple question: "How do I choose a seed for the random number functions in SAS?" The answer might surprise you: use any seed you like. Each seed of a well-designed random number generator is likely to give rise to a stream of random numbers, [...] The post How to choose a seed for generating random numbers in SAS appeared first on The DO Loop.

Read more »

On the SMOOTHCONNECT option in the SERIES statement

May 30, 2017
By
On the SMOOTHCONNECT option in the SERIES statement

By default, when you use the SERIES statement in PROC SGPLOT to create a line plot, the observations are connected (in order) by straight line segments. However, SAS 9.4m1 introduced the SMOOTHCONNECT option which, as the name implies, uses a smooth curve to connect the observations. In Sanjay Matange's blog, [...] The post On the SMOOTHCONNECT option in the SERIES statement appeared first on The DO Loop.

Read more »

Sample quantiles: A comparison of 9 definitions

May 24, 2017
By
Sample quantiles: A comparison of 9 definitions

According to Hyndman and Fan ("Sample Quantiles in Statistical Packages," TAS, 1996), there are nine definitions of sample quantiles that commonly appear in statistical software packages. Hyndman and Fan identify three definitions that are based on rounding and six methods that are based on linear interpolation. This blog post shows [...] The post Sample quantiles: A comparison of 9 definitions appeared first on The DO Loop.

Read more »

Quantile definitions in SAS

May 22, 2017
By
Quantile definitions in SAS

In last week's article about the Flint water crisis, I computed the 90th percentile of a small data set. Although I didn't mention it, the value that I reported is different from the the 90th percentile that is reported in Significance magazine. That is not unusual. The data only had [...] The post Quantile definitions in SAS appeared first on The DO Loop.

Read more »


Subscribe

Email:

  Subscribe