110 likes | 227 Views
RECONSTRUCTING. By Gilbert MacKenzie The Centre for Medical Statistics. Introduction. A growing concern in the academic statistical community is that the package is dated, in terms of three key areas: Technical Content Inconsistencies Programme Structure
E N D
RECONSTRUCTING By Gilbert MacKenzie The Centre for Medical Statistics
Introduction • A growing concern in the academic statistical community is that the package is dated, in terms of three key areas: • Technical Content • Inconsistencies • Programme Structure • These are of course inter-related.
Technical Content • Weak mainly in relation Complex Modelling: • Linear Mixed Models • Generalised Linear Models ! • Generalised Linear Mixed Models • NB: Websiterefers toCNLR
CNLR Fitting the Generalised Time Dependent Logistic Survival Model (MacKenzie, 1996, JRSS D, 45, 1, 21-34; SIM, 1997, 16, 1831-1843.) GTDL: TDL: RR:
CNLR - Typical Programme model program b0 = 0.05 alpha = 0.01. compute const = 1. compute fi = 0. compute lambda = exp(fi). compute term0 = b0*const. compute term1 = term0 + alpha*surtim. compute pi = exp(term1)/(1+exp(term1)). compute qi = 1-pi. compute wi = (1+exp(term0)). compute pred = ( ( 1+exp(term1)) / ( 1+exp(term0)) )**(-lambda/alpha) . compute loss = -1*(di*fi+di*ln(pi)+(lambda/alpha)*(ln(qi)+ln(wi)) ). cnlr di /pred = pred /loss=loss/save=pred/bootstrap. First time CNLR is used for survival analysis - this is the method but, watch out the bootstrap does not respect the censoring distribution
Programme Structure • There are constraints on the storage and control structures. • Single Data Object • Few Statistical Objects • Programme States restrict command order • Black Boxes Model Program, Macro, Matrix, etc
Single Data Object • Constrains… • Storage for Statistical Objects – vectors matrices, lists • Thinking about appropriate programme structures • Thinking about output ! • One partial solution – is a statistical object file
Programme States & Black Boxes • Phases: Initial Input Transformation Procedure • Command Order? • loop #j =1 to n • frequencies vec(a(#j)) to vec (b(#j)) • end loop • But cannot currently mix procedures & loops !! • Black Boxes? • Macro - No Support for Vectors & Matrices • Matrix - No Procedures - write your own?
Matrix • For • Clear Control Structures • Supports Vector & Matrix Structures • Good Matrix Language • Against • No SPSS Procedures ! • No Scientific Library ! • Poor Error Reporting & Output !
Matrix Development Input Data File call eigen (A, B, C) call crosstabs ( data=mydata, vars= a by b by c,…, table = mytable) call glm (data =mytable, link = log, dist= poisson, model = a+b+c, fit = myfit) call extract (data=myfit, vec=$residuals) call histogram (vec, …) Output Statistical Object
Conclusions • Obvious need to • Improve the Technical Content of SPSS • Create a Consistent Programming Environment • Support Object Orientated Language • Encourage a Technical Development Group