Code covered by the BSD License  

Highlights from
LinStats

4.33333

4.3 | 3 ratings Rate this file 22 Downloads (last 30 days) File Size: 455.63 KB File ID: #29876

LinStats

by Michael Boedigheimer

 

01 Jan 2011

Statistical analysis (ANOVA,…) and plotting of fixed and mixed effects models using modern methods

| Watch this File

File Information
Description

LinStats is a collection of classes, functions and data that are useful for representing, solving and analyzing linear statistical models. LinStats has been updated to use a new object based approach to support incremental model-building and more sophisticated analysis.
Notably this is the first Matlab statistical package that can handle ANOVA and Variance Components models with fixed and random effects using Restricted Estimated Maximum Likelihood (REML) including the modern corrections for small sample size. This allows improved estimates for both fixed (Best linear unbiased estimates) and random terms (Best linear unbiased predictors).
Many statistical analysis including ANOVA involve random factors which poses challenging problems. Old solutions used approximations that were required before the advent of computers. Modern solutions use Restricted Estimated Maximum Likelihood. More recent enhancements and refinements include corrections for small sample size (Kenward and Roger) and take into account the uncertainty that parameter estimates have on variance estimates (Harville and Kackar).
This approach is becoming more common but the calculations are complex and this has slowed implementation. Matlab and R, for example, do not support this. I have only seen it in Professional statistics programs like SAS/JMP. Now, for the first time, Matlab Stats users don't need to take a backseat to users of those languages (at least in terms of mixed model analysis of linear models).
Fixed effects analysis outputs have been validated using National Institute of Standards and Technology Standards Technology Reference most difficult datasets (included with Linstats). Random effects outputs have been checked against results produced by SAS/JMP.
Please see zip file for the Word document containing the most complete documentation available.

Required Products Optimization Toolbox
Statistics Toolbox
MATLAB release MATLAB 7.11 (2010b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
24 Feb 2011 Pasquale  
07 Nov 2011 Steven

Thank you for building this!

02 Mar 2012 Daren Howell

I've just installed this with R2011a and have run test_linstats which has thrown up a number of "Cell contents reference from a non-cell array object" errors.

Has anyone else had similar troubles with R2011a?

02 Mar 2012 Daren Howell

Update on above - seems to be related to referencing elements of the Pmat class.

The code references elements using cell array notation e.g. A{2,2}, which throws an error, whereas array notation A(2,2) doesn't.

02 Mar 2012 Michael Boedigheimer

Daren. Due to a documented bug in Matlab 2011 series, LinStats does not work. The bug is fixed in Matlab 2012a, out today I think.

08 Mar 2012 Daren Howell

Think it mayhave something to do with a different bug in this release.

You call, optimset('fminunc'), which should return the options structure but instead throws an error.

I'll see what the Mathworks make of this.

08 Mar 2012 Daren Howell

Looks like there was a pathdef error in my installation and I'd lost a link to optimset. Test_linstats output below.

Thanks for freeing me from SAS!!!

passed: ArgParser
passed: Pmat standard ops
Warning: Colon operands must be real scalars.
> In test_dmat at 4
  In test_linstats at 4
passed: Dmat
passed: BDmat
passed: lsestimates
passed: mixed models
passed: fixed effects model
passed: fixed effects model, no intercept
passed: 2-way anacova (separate lines)
Warning: The RandStream.getDefaultStream static method will be removed in a
future release. Use RandStream.getGlobalStream instead.
> In RandStream.RandStream>RandStream.getDefaultStream at 460
  In test_model at 121
  In test_linstats at 8
passed: 2-way anacova (separate lines), multiple response
passed: mixed effects, clinical example
passed: mixed effects, unbalanced clinical example

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Michael Boedigheimer 03 Jan 2011 11:54:35
gui Michael Boedigheimer 03 Jan 2011 11:54:35
optimization Michael Boedigheimer 03 Jan 2011 11:54:35
anova Michael Boedigheimer 03 Jan 2011 11:54:35
mixed model Michael Boedigheimer 03 Jan 2011 11:54:35
random effects Michael Boedigheimer 03 Jan 2011 11:54:35
plotting Michael Boedigheimer 03 Jan 2011 11:54:35
parser Michael Boedigheimer 03 Jan 2011 11:54:35

Contact us at files@mathworks.com