Preview of Statistical Inference Package (SIP) 2.0

Esa Uusipaikka

University of Turku

Contents

Statistical Inference Package (SIP)

Version 2.0 of SIP

Data management

Exploration of  data

Definition of the statistical model for the response

Exploration of the statistical model

Statistical inference using confidence intervals

Model criticism

Analyzing response with a given statistical model

Model formula

More accurate confidence intervals

Simultaneous confidence intervals

Statistical Inference Package (SIP)

Statistical Inference Package (SIP) is a Mathematica package for doing likelihood-based statistical inference. It contains a large set of functions for defining statistical models for empirical data. These include

sampling model

general linear model

nonlinear regression model

logistic regression model

Poisson regression model

generalized linear model

multinomial regression model

multivariate linear regression model

mixture model

mixed model

Markov chain model

Hidden Markov model

etc.

Using these models with data SIP provides the user methods for calculation profile likelihood-based confidence intervals for any smooth real-valued function of the parameters and likelihood ratio tests for statistical hypothesis defined by any smooth real-valued functions of the parameters.

Version 2.0 of SIP

Version 2.0 of SIP includes following new features.

model formula

higher order correction for confidence intervals

bootstrap correction for confidence intervals and likelihood ratio tests

simultaneous confidence intervals

calculation and plotting residuals for regression model

various random effect regression models

proportional odds and hazard (Cox) regression models

data management

view of models and results

plot of data and results

etc.

Data management

Reading data

ReadDataset["BrainWeights",{"species","brainWeight","bodyWeight"},Print->True];

Attaching data

AttachDataset["BrainWeights"]

Exploration of data

View data

ViewDataset["BrainWeights"]

Exploration of data

Show data

ShowDataset["BrainWeights"]

Exploration of data

Logarithm of brain weight against logarithm of body weight

ListPlot[Transpose[{logBodyWeigth=Log[bodyWeight],Log[brainWeight]}],Axes->False,Frame->True,PlotStyle->PointSize[.02]]

Exp[4.1]
Exp[7.2]

Defining a statistical model for response

Gamma regression model

constant = 1&/@brainWeight;
logBodyWeigth=Log[bodyWeight];
ℳ=GeneralizedLinearRegressionModel[Transpose[{constant,logBodyWeigth}],Distribution->GammaModel[ν,μ],LinkFunction->Log];

Exploration of model

View model

ViewModel[GammaModel[ν,μ]]

Exploration of model

Show model

ShowModel[GammaModel[ν,μ]]

Statistical inference using confidence intervals

Profile likelihood-based confidence interval for the 'slope'

ProfileInterval[ℳ,brainWeight,(Subscript[β, 2]),{{(Subscript[β, 1]),(Subscript[β, 2])},ν}]//ConfidenceLimits

Profile likelihood-based confidence interval for the mean body weight of a species with mean brain weight 1320.02 kg.

(Subscript[ψ, 1])=(E^((7.1854-(Subscript[β, 1]))/(Subscript[β, 2])));

ProfileInterval[ℳ,brainWeight,(Subscript[ψ, 1]),{{(Subscript[β, 1]),(Subscript[β, 2])},ν}]//ConfidenceLimits

Profile likelihood-based confidence interval for the probability that the brain weight is larger than 1320.02 g for a species with mean body weight 62.0 kg.

(Subscript[ψ, 2])=(1-DistributionFunction[GammaModel[ν,μ],1320.02,{ν,μ}]/.μ->(E^((Subscript[β, 1])+4.1271 (Subscript[β, 2]))));

ProfileInterval[ℳ,brainWeight,(Subscript[ψ, 2]),{{(Subscript[β, 1]),(Subscript[β, 2])},ν}]//ConfidenceLimits

Model criticism

Residuals

ℱ=MLEFit[ℳ,brainWeight];

ListPlot[Transpose[{logBodyWeigth,res=GammaRegressionResiduals[ℱ,3]}],Axes->False,Frame->True,PlotRange->All,PlotStyle->PointSize[.02]]

Pick[species,(#≥3)&/@res]

Pick[species,(#≥1.3)&/@res]

Analyzing response with a given statistical model

ReadDataset["FuelConsumption",{"day","consumption","airTemperature","windVelocity"},Print->False];
AttachDataset["FuelConsumption"];

ListPointPlot3D[Transpose[{airTemperature,windVelocity,consumption}],PlotStyle->PointSize[.02]]

Analyzing response with a given statistical model

constant=1&/@consumption;
ℳ=LinearRegressionModel[Transpose[{constant,airTemperature,windVelocity}]];

AnalyzeResponseUsingModel[consumption,ℳ,{{(Subscript[β, 0]),(Subscript[β, 1]),(Subscript[β, 2])},σ},""]

Model formula

ReadDataset["Waste",{"temperature","environment","wasteOuput"},Print->False];
AttachDataset["Waste"];

constant=1&/@ wasteOuput;
environmentCat=ToString/@ environment;
GenerateModelMatrix[constant⊕temperature⊗environmentCat]//First//Transpose//MatrixForm

GenerateModelMatrix[constant⊕temperature⊕environmentCat]//First//Transpose//MatrixForm

GenerateModelMatrix[constant⊕temperature⊗environment]//First//Transpose//MatrixForm

GenerateModelMatrix[constant⊕temperature⊕environment]//First//Transpose//MatrixForm

GenerateModelMatrix[constant⊕temperature⊕environment⊗environment⊗environment]//First//Transpose//MatrixForm

More accurate confidence intervals

Higher-order correction

ReadDataset["FuelConsumption",{"day","consumption","airTemperature","windVelocity"},Print->False];
AttachDataset["FuelConsumption"];

constant=1&/@consumption;
ℳ=LinearRegressionModel[Transpose[{constant,airTemperature,windVelocity}]];

(Subscript[ℐ, 1])=ConfidenceLimits[ProfileInterval[ℳ,consumption,(Subscript[β, 1]),{{(Subscript[β, 0]),(Subscript[β, 1]),(Subscript[β, 2])},σ}]]

(Subscript[ℐ, 2])=ConfidenceLimits[ProfileInterval[ℳ,consumption,(Subscript[β, 1]),{{(Subscript[β, 0]),(Subscript[β, 1]),(Subscript[β, 2])},σ},HigherOrder->True]]

(Subscript[ℐ, 3])=ConfidenceLimitsFromStudentTDistribution[ProfileInterval[ℳ,consumption,(Subscript[β, 1]),{{(Subscript[β, 0]),(Subscript[β, 1]),(Subscript[β, 2])},σ}],7]

(Subscript[ℐ, 3])-(Subscript[ℐ, 1])
(Subscript[ℐ, 3])-(Subscript[ℐ, 2])

Simultaneous confidence intervals

ReadDataset["RedCloverPlants",{"treatment","nitrogen"},Print->False];
AttachDataset["RedCloverPlants"];

ℳ=LinearRegressionModel[treatment];

ω={{{(Subscript[β, "3DOK1"]),(Subscript[β, "3DOK5"]),(Subscript[β, "3DOK4"]),(Subscript[β, "3DOK7"]),(Subscript[β, "3DOK13"]),(Subscript[β, "COMPOS"])}},σ};
pairwiseDifferences=Flatten[Differences/@Subsets[Flatten[First[ω]],{2}]];

ℐ=ProfileInterval[ℳ,nitrogen,pairwiseDifferences,ω];
TableForm[({InterestFunction[#,ω],First[ConfidenceLimits[#]],Last[ConfidenceLimits[#]]}&/@ℐ),TableHeadings->{None,{"Interest function","Lower limit","Upper limit"}}]

SIP-package

Downloadable from

http : // www.wolfram.com/products/applications/sip/

Technical support from

support@statisticalinference.com

More information from

http : // www.statisticalinference.com

Developed by

Esa Uusipaikka
	 Professor of Statistics
	
	 Head of Department of Statistics	
	 University of Turku
	 FI - 20014 Turun yliopisto
	 Finland	
	
	 Phone :               +358 - 2 - 333 5436
	 Email :                esa.uusipaikka@utu.fi
	 WWW :               http : // users.utu.fi/esauusi/esauusi.htm