Multiplicative Interaction Models in R

Multiplicative Interaction Models in R

      Heather Turner and David Firth


              Department of Statistics
            The University of Warwick, UK



                  8th August 2005
Multiplicative Interaction Models

– Interaction terms in generalized linear models can be over-complex

  ª use multiplicative interactions instead
– e.g. Goodmans’ row-column association model

                            log µrc = αr + βc + γr δc

– e.g. UNIDIFF model
                           log µijk = αik + βjk + γk δij

– e.g. GAMMI model

                                                 K
                       link(µrc ) = αr + βc +         σk γkr δkc
                                                k=1
Fitting Multiplicative Interaction Models

– Multiplicative interactions are non-linear

  ª difficult to fit using standard software
– Llama (Log Linear and Multiplicative Analysis) written by Firth (1998)

  ª log link only
  ª categorical variables only
  ª standard multiplicative interactions
  ª XLisp package
The gnm R Package

– Provides framework for estimating generalised nonlinear models

  ª in-built mechanism for multiplicative terms
  ª works with “plug-in” functions to fit other types of nonlinear terms
– Designed to be glm-like

  ª common arguments, returned objects, methods, etc
– Estimates model parameters using maximum likelihood

– Uses over-parameterised representations of models
Working with Over-Parameterised Models

–   gnm does not impose any identifiability constraints on the nonlinear parameters
    ª the same model can be represented by an infinite number of
       parameterizations, e.g.

                            log µrc = αr + βc + γr δc
                                   = αr + βc + (2γr )(0.5δc )
                                                   ′   ′
                                   = αr + βc + γr δc

    ª gnm will return one of these parameterisations, at random
– General rule for applying constraints not required

– Fitting algorithm must be able to handle singular matrices
Parameter Estimation

– Wish to estimate the predictor
                                       η = η(β)
  which is nonlinear, so we have a local design matrix

                                             ∂η
                                      X(β) =
                                             ∂β
  where rank(X)     < p, the no. of parameters, due to over-parameterisation
– Use maximum likelihood estimation: want to solve the likehood score equations

                                   U (β) = ∇l(β) = 0
Fitting Algorithm

– Use a two stage procedure:

  1. one-parameter-at-a-time Newton method to update nonlinear parameters

  2. full Newton-Raphson to update all parameters but with the Moore-Penrose
     pseudoinverse (X T W X)− since X is not of full rank

– Starting values are obtained in two ways

  for the linear parameters use estimates from a glm fit

  for the nonlinear parameters generate randomly

  ª parameterization determined by starting values for nonlinear parameters
Model Specification

– Models in R are usually specified by a symbolic formula, such as

                                   y ∼a+b+a:b

–   gnm introduces two functions to specify nonlinear terms
    ª Mult for standard multiplicative interactions, e.g.
       counts ∼ row + column +
           Mult(-1 + row, -1 + column)
    ª Nonlin for other terms that require a “plug-in” function, e.g.
       counts ∼ row + column +
           Nonlin(MultHomog(row, column))
Example: Occupational Status Data

– Study of occupational status taken from Goodman (1979)

– Cross-classified by occupational status of father (origin) and son (destination)

  > occupationalStatus
        destination
  origin   1   2   3   4            5     6   7   8
       1 50 19 26      8            7    11   6   2
       2 16 40 34 18               11    20   8   3
       3 12 35 65 66               35    88 23 21
       4 11 20 58 110              40   183 64 32
       5   2   8 12 23             25    46 28 12
       6 12 28 102 162             90   554 230 177
       7   0   6 19 40             21   158 143 71
       8   0   3 14 32             15   126 91 106
Homogeneous Row-Column Association Model
Call:
gnm(formula = Freq ˜ origin + destination + Diag(origin, destination) +
    Nonlin(MultHomog(origin, destination)), family = poisson,
    data = occupationalStatus)

Coefficients:
                     (Intercept)                          origin2
                         0.01031                          0.52684
                               ...
                         origin8                     destination2
                         1.29563                          0.94586
                               ...
                    destination8       Diag(origin, destination)1
                         1.87101                          1.52667
                               ...
      Diag(origin, destination)8 MultHomog(origin, destination).1
                         0.38848                         -1.54112
                               ...
MultHomog(origin, destination).8
                         1.04786
Homogeneous Row-column Association Model (Contd.)
  Deviance:            32.56098
  Pearson chi-squared: 31.20718
  Residual df:         34


– Compare to model with heterogeneous multiplicative effects
  > RC <- gnm(Freq ˜ origin + destination + Diag(origin, destination) +
  +                Mult(origin, destination), family = poisson,
  +                data = occupationalStatus)
  > RChomog$dev - RC$dev
  [1] 3.411823
  > RChomog$df.residual - RC$df.residual
  [1] 6
Estimate Identifiable Contrasts

– Unconstrained parameters of homogeneous multiplicative factor not identifiable

– Contrast effects with lowest level
  > round(getContrasts(RChomog, rev(coefs.of.interest))[[1]], 5)
                                   estimate      se
  MultHomog(origin, destination).8 2.58898 0.18869
  MultHomog(origin, destination).7 2.34541 0.17263
  MultHomog(origin, destination).6 1.92927 0.15737
  MultHomog(origin, destination).5 1.41751 0.17195
  MultHomog(origin, destination).4 1.40034 0.16029
  MultHomog(origin, destination).3 0.81646 0.16665
  MultHomog(origin, destination).2 0.21829 0.23465
  MultHomog(origin, destination).1 0.00000 0.00000
Concluding Remarks

–   gnm has many more useful features
    ª for multiplicative models: functional factors, Exp, multiplicity
    ª other: symmetric interactions, diagonal reference models, eliminate, ...
– More details can be found on
    http://www.warwick.ac.uk/go/dfirth/software/gnm

– Available on CRAN http://cran.r-project.org
1 of 13

Recommended

音声認識技術の変遷 by
音声認識技術の変遷音声認識技術の変遷
音声認識技術の変遷emonosuke
938 views13 slides
1 Supervised learning by
1 Supervised learning1 Supervised learning
1 Supervised learningDmytro Fishman
1.6K views291 slides
Conditional Random Fields - Vidya Venkiteswaran by
Conditional Random Fields - Vidya VenkiteswaranConditional Random Fields - Vidya Venkiteswaran
Conditional Random Fields - Vidya VenkiteswaranWithTheBest
1.3K views19 slides
Restricted Boltzmann Machine - A comprehensive study with a focus on Deep Bel... by
Restricted Boltzmann Machine - A comprehensive study with a focus on Deep Bel...Restricted Boltzmann Machine - A comprehensive study with a focus on Deep Bel...
Restricted Boltzmann Machine - A comprehensive study with a focus on Deep Bel...Indraneel Pole
5.4K views29 slides
今さら聞けないカーネル法とサポートベクターマシン by
今さら聞けないカーネル法とサポートベクターマシン今さら聞けないカーネル法とサポートベクターマシン
今さら聞けないカーネル法とサポートベクターマシンShinya Shimizu
131.6K views56 slides
Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is... by
Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...
Introduction to Graph Neural Networks: Basics and Applications - Katsuhiko Is...Preferred Networks
9.2K views81 slides

More Related Content

What's hot

Deep Learning: Recurrent Neural Network (Chapter 10) by
Deep Learning: Recurrent Neural Network (Chapter 10) Deep Learning: Recurrent Neural Network (Chapter 10)
Deep Learning: Recurrent Neural Network (Chapter 10) Larry Guo
3.8K views110 slides
RUTILEA社内勉強会第4回 「敵対的生成ネットワーク(GAN)」 by
RUTILEA社内勉強会第4回 「敵対的生成ネットワーク(GAN)」RUTILEA社内勉強会第4回 「敵対的生成ネットワーク(GAN)」
RUTILEA社内勉強会第4回 「敵対的生成ネットワーク(GAN)」TRUE_RUTILEA
352 views19 slides
Text Classification/Categorization by
Text Classification/CategorizationText Classification/Categorization
Text Classification/CategorizationOswal Abhishek
1.2K views21 slides
Page rank by
Page rankPage rank
Page rankluyen91
1.1K views27 slides
Artificial Neural Networks Lect1: Introduction & neural computation by
Artificial Neural Networks Lect1: Introduction & neural computationArtificial Neural Networks Lect1: Introduction & neural computation
Artificial Neural Networks Lect1: Introduction & neural computationMohammed Bennamoun
5K views34 slides
Tutorial on end-to-end text-to-speech synthesis: Part 1 – Neural waveform mod... by
Tutorial on end-to-end text-to-speech synthesis: Part 1 – Neural waveform mod...Tutorial on end-to-end text-to-speech synthesis: Part 1 – Neural waveform mod...
Tutorial on end-to-end text-to-speech synthesis: Part 1 – Neural waveform mod...Yamagishi Laboratory, National Institute of Informatics, Japan
5.2K views69 slides

What's hot(20)

Deep Learning: Recurrent Neural Network (Chapter 10) by Larry Guo
Deep Learning: Recurrent Neural Network (Chapter 10) Deep Learning: Recurrent Neural Network (Chapter 10)
Deep Learning: Recurrent Neural Network (Chapter 10)
Larry Guo3.8K views
RUTILEA社内勉強会第4回 「敵対的生成ネットワーク(GAN)」 by TRUE_RUTILEA
RUTILEA社内勉強会第4回 「敵対的生成ネットワーク(GAN)」RUTILEA社内勉強会第4回 「敵対的生成ネットワーク(GAN)」
RUTILEA社内勉強会第4回 「敵対的生成ネットワーク(GAN)」
TRUE_RUTILEA352 views
Text Classification/Categorization by Oswal Abhishek
Text Classification/CategorizationText Classification/Categorization
Text Classification/Categorization
Oswal Abhishek1.2K views
Page rank by luyen91
Page rankPage rank
Page rank
luyen911.1K views
Artificial Neural Networks Lect1: Introduction & neural computation by Mohammed Bennamoun
Artificial Neural Networks Lect1: Introduction & neural computationArtificial Neural Networks Lect1: Introduction & neural computation
Artificial Neural Networks Lect1: Introduction & neural computation
A Review of Deep Contextualized Word Representations (Peters+, 2018) by Shuntaro Yada
A Review of Deep Contextualized Word Representations (Peters+, 2018)A Review of Deep Contextualized Word Representations (Peters+, 2018)
A Review of Deep Contextualized Word Representations (Peters+, 2018)
Shuntaro Yada19.4K views
Multi-Task Learning for NLP by Motoki Sato
Multi-Task Learning for NLPMulti-Task Learning for NLP
Multi-Task Learning for NLP
Motoki Sato2.4K views
データ解析2 線形代数の復習 by Hirotaka Hachiya
データ解析2 線形代数の復習データ解析2 線形代数の復習
データ解析2 線形代数の復習
Hirotaka Hachiya1.5K views
決定森回帰の信頼区間推定, Benign Overfitting, 多変量木とReLUネットの入力空間分割 by Ichigaku Takigawa
決定森回帰の信頼区間推定, Benign Overfitting, 多変量木とReLUネットの入力空間分割決定森回帰の信頼区間推定, Benign Overfitting, 多変量木とReLUネットの入力空間分割
決定森回帰の信頼区間推定, Benign Overfitting, 多変量木とReLUネットの入力空間分割
Ichigaku Takigawa463 views
Perceptron by Nagarajan
PerceptronPerceptron
Perceptron
Nagarajan29.5K views
Introduction to Random Forests by Dr. Adele Cutler by Salford Systems
Introduction to Random Forests by Dr. Adele CutlerIntroduction to Random Forests by Dr. Adele Cutler
Introduction to Random Forests by Dr. Adele Cutler
Salford Systems5.1K views
5.3 dynamic programming 03 by Krish_ver2
5.3 dynamic programming 035.3 dynamic programming 03
5.3 dynamic programming 03
Krish_ver22K views
Neural Networks by Adri Jovin
Neural NetworksNeural Networks
Neural Networks
Adri Jovin347 views
グラフデータの機械学習における特徴表現の設計と学習 by Ichigaku Takigawa
グラフデータの機械学習における特徴表現の設計と学習グラフデータの機械学習における特徴表現の設計と学習
グラフデータの機械学習における特徴表現の設計と学習
Ichigaku Takigawa8.8K views

Viewers also liked

gnm: a Package for Generalized Nonlinear Models by
gnm: a Package for Generalized Nonlinear Modelsgnm: a Package for Generalized Nonlinear Models
gnm: a Package for Generalized Nonlinear Modelshtstatistics
3.8K views15 slides
Detecting Drug Effects in the Brain by
Detecting Drug Effects in the BrainDetecting Drug Effects in the Brain
Detecting Drug Effects in the Brainhtstatistics
4.3K views22 slides
Custom Functions for Specifying Nonlinear Terms to gnm by
Custom Functions for Specifying Nonlinear Terms to gnmCustom Functions for Specifying Nonlinear Terms to gnm
Custom Functions for Specifying Nonlinear Terms to gnmhtstatistics
2.6K views19 slides
Modelling the Diluting Effect of Social Mobility on Health Inequality by
Modelling the Diluting Effect of Social Mobility on Health InequalityModelling the Diluting Effect of Social Mobility on Health Inequality
Modelling the Diluting Effect of Social Mobility on Health Inequalityhtstatistics
2.9K views19 slides
BradleyTerry2: Flexible Models for Paired Comparisons by
BradleyTerry2: Flexible Models for Paired ComparisonsBradleyTerry2: Flexible Models for Paired Comparisons
BradleyTerry2: Flexible Models for Paired Comparisonshtstatistics
2.9K views15 slides
From L to N: Nonlinear Predictors in Generalized Models by
From L to N: Nonlinear Predictors in Generalized ModelsFrom L to N: Nonlinear Predictors in Generalized Models
From L to N: Nonlinear Predictors in Generalized Modelshtstatistics
2.2K views32 slides

Viewers also liked(20)

gnm: a Package for Generalized Nonlinear Models by htstatistics
gnm: a Package for Generalized Nonlinear Modelsgnm: a Package for Generalized Nonlinear Models
gnm: a Package for Generalized Nonlinear Models
htstatistics3.8K views
Detecting Drug Effects in the Brain by htstatistics
Detecting Drug Effects in the BrainDetecting Drug Effects in the Brain
Detecting Drug Effects in the Brain
htstatistics4.3K views
Custom Functions for Specifying Nonlinear Terms to gnm by htstatistics
Custom Functions for Specifying Nonlinear Terms to gnmCustom Functions for Specifying Nonlinear Terms to gnm
Custom Functions for Specifying Nonlinear Terms to gnm
htstatistics2.6K views
Modelling the Diluting Effect of Social Mobility on Health Inequality by htstatistics
Modelling the Diluting Effect of Social Mobility on Health InequalityModelling the Diluting Effect of Social Mobility on Health Inequality
Modelling the Diluting Effect of Social Mobility on Health Inequality
htstatistics2.9K views
BradleyTerry2: Flexible Models for Paired Comparisons by htstatistics
BradleyTerry2: Flexible Models for Paired ComparisonsBradleyTerry2: Flexible Models for Paired Comparisons
BradleyTerry2: Flexible Models for Paired Comparisons
htstatistics2.9K views
From L to N: Nonlinear Predictors in Generalized Models by htstatistics
From L to N: Nonlinear Predictors in Generalized ModelsFrom L to N: Nonlinear Predictors in Generalized Models
From L to N: Nonlinear Predictors in Generalized Models
htstatistics2.2K views
Nonlinear Discrete-time Hazard Models for Entry into Marriage by htstatistics
Nonlinear Discrete-time Hazard Models for Entry into MarriageNonlinear Discrete-time Hazard Models for Entry into Marriage
Nonlinear Discrete-time Hazard Models for Entry into Marriage
htstatistics3.2K views
Generalized Bradley-Terry Modelling of Football Results by htstatistics
Generalized Bradley-Terry Modelling of Football ResultsGeneralized Bradley-Terry Modelling of Football Results
Generalized Bradley-Terry Modelling of Football Results
htstatistics4.3K views
Clustering Microarray Data by htstatistics
Clustering Microarray DataClustering Microarray Data
Clustering Microarray Data
htstatistics2.6K views
Sample slides from "Programming with R" course by htstatistics
Sample slides from "Programming with R" courseSample slides from "Programming with R" course
Sample slides from "Programming with R" course
htstatistics2.5K views
Sample slides from "Getting Started with R" course by htstatistics
Sample slides from "Getting Started with R" courseSample slides from "Getting Started with R" course
Sample slides from "Getting Started with R" course
htstatistics2.3K views
4 Circles Of Good Business 09 by seabeehmk
4 Circles Of Good Business 094 Circles Of Good Business 09
4 Circles Of Good Business 09
seabeehmk338 views
Advances in automatic time series forecasting by Rob Hyndman
Advances in automatic time series forecastingAdvances in automatic time series forecasting
Advances in automatic time series forecasting
Rob Hyndman4.2K views
Chap15 time series forecasting & index number by Uni Azza Aunillah
Chap15 time series forecasting & index numberChap15 time series forecasting & index number
Chap15 time series forecasting & index number
Uni Azza Aunillah9.6K views
God’S Grace And Truth by BriLeeUbb
God’S  Grace And  TruthGod’S  Grace And  Truth
God’S Grace And Truth
BriLeeUbb493 views
Hvordan jobbe smidig som interaksjondesigner by Klara Vatn
Hvordan jobbe smidig som interaksjondesigner Hvordan jobbe smidig som interaksjondesigner
Hvordan jobbe smidig som interaksjondesigner
Klara Vatn718 views

Similar to Multiplicative Interaction Models in R

MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the... by
MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...
MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...The Statistical and Applied Mathematical Sciences Institute
88 views30 slides
MUMS Opening Workshop - An Overview of Reduced-Order Models and Emulators (ED... by
MUMS Opening Workshop - An Overview of Reduced-Order Models and Emulators (ED...MUMS Opening Workshop - An Overview of Reduced-Order Models and Emulators (ED...
MUMS Opening Workshop - An Overview of Reduced-Order Models and Emulators (ED...The Statistical and Applied Mathematical Sciences Institute
90 views40 slides
ICML2013読み会 Large-Scale Learning with Less RAM via Randomization by
ICML2013読み会 Large-Scale Learning with Less RAM via RandomizationICML2013読み会 Large-Scale Learning with Less RAM via Randomization
ICML2013読み会 Large-Scale Learning with Less RAM via RandomizationHidekazu Oiwa
14.8K views22 slides
Firefly exact MCMC for Big Data by
Firefly exact MCMC for Big DataFirefly exact MCMC for Big Data
Firefly exact MCMC for Big DataGianvito Siciliano
1K views24 slides
Introduction to PyTorch by
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorchJun Young Park
539 views29 slides
SIAM_QMC_Fourier_Pricing_Pres.pdf by
SIAM_QMC_Fourier_Pricing_Pres.pdfSIAM_QMC_Fourier_Pricing_Pres.pdf
SIAM_QMC_Fourier_Pricing_Pres.pdfMichaelSamet4
29 views35 slides

Similar to Multiplicative Interaction Models in R(20)

ICML2013読み会 Large-Scale Learning with Less RAM via Randomization by Hidekazu Oiwa
ICML2013読み会 Large-Scale Learning with Less RAM via RandomizationICML2013読み会 Large-Scale Learning with Less RAM via Randomization
ICML2013読み会 Large-Scale Learning with Less RAM via Randomization
Hidekazu Oiwa14.8K views
SIAM_QMC_Fourier_Pricing_Pres.pdf by MichaelSamet4
SIAM_QMC_Fourier_Pricing_Pres.pdfSIAM_QMC_Fourier_Pricing_Pres.pdf
SIAM_QMC_Fourier_Pricing_Pres.pdf
MichaelSamet429 views
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf by RTEFGDFGJU
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdfreservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
RTEFGDFGJU34 views
Pseudo Random Number Generators by Darshini Parikh
Pseudo Random Number GeneratorsPseudo Random Number Generators
Pseudo Random Number Generators
Darshini Parikh5.4K views
Contrastive Divergence Learning by penny 梁斌
Contrastive Divergence LearningContrastive Divergence Learning
Contrastive Divergence Learning
penny 梁斌1K views
pptx - Psuedo Random Generator for Halfspaces by butest
pptx - Psuedo Random Generator for Halfspacespptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspaces
butest253 views
pptx - Psuedo Random Generator for Halfspaces by butest
pptx - Psuedo Random Generator for Halfspacespptx - Psuedo Random Generator for Halfspaces
pptx - Psuedo Random Generator for Halfspaces
butest265 views
Error control coding bch, reed-solomon etc.. by Madhumita Tamhane
Error control coding   bch, reed-solomon etc..Error control coding   bch, reed-solomon etc..
Error control coding bch, reed-solomon etc..
Madhumita Tamhane8.9K views
Multinomial Logistic Regression with Apache Spark by DB Tsai
Multinomial Logistic Regression with Apache SparkMultinomial Logistic Regression with Apache Spark
Multinomial Logistic Regression with Apache Spark
DB Tsai12.9K views
Alpine Spark Implementation - Technical by alpinedatalabs
Alpine Spark Implementation - TechnicalAlpine Spark Implementation - Technical
Alpine Spark Implementation - Technical
alpinedatalabs10.4K views
Svm map reduce_slides by Sara Asher
Svm map reduce_slidesSvm map reduce_slides
Svm map reduce_slides
Sara Asher2.3K views
Reed solomon Encoder and Decoder by Ameer H Ali
Reed solomon Encoder and DecoderReed solomon Encoder and Decoder
Reed solomon Encoder and Decoder
Ameer H Ali383 views
The Magic of Auto Differentiation by Sanyam Kapoor
The Magic of Auto DifferentiationThe Magic of Auto Differentiation
The Magic of Auto Differentiation
Sanyam Kapoor343 views

Multiplicative Interaction Models in R

  • 1. Multiplicative Interaction Models in R Heather Turner and David Firth Department of Statistics The University of Warwick, UK 8th August 2005
  • 2. Multiplicative Interaction Models – Interaction terms in generalized linear models can be over-complex ª use multiplicative interactions instead – e.g. Goodmans’ row-column association model log µrc = αr + βc + γr δc – e.g. UNIDIFF model log µijk = αik + βjk + γk δij – e.g. GAMMI model K link(µrc ) = αr + βc + σk γkr δkc k=1
  • 3. Fitting Multiplicative Interaction Models – Multiplicative interactions are non-linear ª difficult to fit using standard software – Llama (Log Linear and Multiplicative Analysis) written by Firth (1998) ª log link only ª categorical variables only ª standard multiplicative interactions ª XLisp package
  • 4. The gnm R Package – Provides framework for estimating generalised nonlinear models ª in-built mechanism for multiplicative terms ª works with “plug-in” functions to fit other types of nonlinear terms – Designed to be glm-like ª common arguments, returned objects, methods, etc – Estimates model parameters using maximum likelihood – Uses over-parameterised representations of models
  • 5. Working with Over-Parameterised Models – gnm does not impose any identifiability constraints on the nonlinear parameters ª the same model can be represented by an infinite number of parameterizations, e.g. log µrc = αr + βc + γr δc = αr + βc + (2γr )(0.5δc ) ′ ′ = αr + βc + γr δc ª gnm will return one of these parameterisations, at random – General rule for applying constraints not required – Fitting algorithm must be able to handle singular matrices
  • 6. Parameter Estimation – Wish to estimate the predictor η = η(β) which is nonlinear, so we have a local design matrix ∂η X(β) = ∂β where rank(X) < p, the no. of parameters, due to over-parameterisation – Use maximum likelihood estimation: want to solve the likehood score equations U (β) = ∇l(β) = 0
  • 7. Fitting Algorithm – Use a two stage procedure: 1. one-parameter-at-a-time Newton method to update nonlinear parameters 2. full Newton-Raphson to update all parameters but with the Moore-Penrose pseudoinverse (X T W X)− since X is not of full rank – Starting values are obtained in two ways for the linear parameters use estimates from a glm fit for the nonlinear parameters generate randomly ª parameterization determined by starting values for nonlinear parameters
  • 8. Model Specification – Models in R are usually specified by a symbolic formula, such as y ∼a+b+a:b – gnm introduces two functions to specify nonlinear terms ª Mult for standard multiplicative interactions, e.g. counts ∼ row + column + Mult(-1 + row, -1 + column) ª Nonlin for other terms that require a “plug-in” function, e.g. counts ∼ row + column + Nonlin(MultHomog(row, column))
  • 9. Example: Occupational Status Data – Study of occupational status taken from Goodman (1979) – Cross-classified by occupational status of father (origin) and son (destination) > occupationalStatus destination origin 1 2 3 4 5 6 7 8 1 50 19 26 8 7 11 6 2 2 16 40 34 18 11 20 8 3 3 12 35 65 66 35 88 23 21 4 11 20 58 110 40 183 64 32 5 2 8 12 23 25 46 28 12 6 12 28 102 162 90 554 230 177 7 0 6 19 40 21 158 143 71 8 0 3 14 32 15 126 91 106
  • 10. Homogeneous Row-Column Association Model Call: gnm(formula = Freq ˜ origin + destination + Diag(origin, destination) + Nonlin(MultHomog(origin, destination)), family = poisson, data = occupationalStatus) Coefficients: (Intercept) origin2 0.01031 0.52684 ... origin8 destination2 1.29563 0.94586 ... destination8 Diag(origin, destination)1 1.87101 1.52667 ... Diag(origin, destination)8 MultHomog(origin, destination).1 0.38848 -1.54112 ... MultHomog(origin, destination).8 1.04786
  • 11. Homogeneous Row-column Association Model (Contd.) Deviance: 32.56098 Pearson chi-squared: 31.20718 Residual df: 34 – Compare to model with heterogeneous multiplicative effects > RC <- gnm(Freq ˜ origin + destination + Diag(origin, destination) + + Mult(origin, destination), family = poisson, + data = occupationalStatus) > RChomog$dev - RC$dev [1] 3.411823 > RChomog$df.residual - RC$df.residual [1] 6
  • 12. Estimate Identifiable Contrasts – Unconstrained parameters of homogeneous multiplicative factor not identifiable – Contrast effects with lowest level > round(getContrasts(RChomog, rev(coefs.of.interest))[[1]], 5) estimate se MultHomog(origin, destination).8 2.58898 0.18869 MultHomog(origin, destination).7 2.34541 0.17263 MultHomog(origin, destination).6 1.92927 0.15737 MultHomog(origin, destination).5 1.41751 0.17195 MultHomog(origin, destination).4 1.40034 0.16029 MultHomog(origin, destination).3 0.81646 0.16665 MultHomog(origin, destination).2 0.21829 0.23465 MultHomog(origin, destination).1 0.00000 0.00000
  • 13. Concluding Remarks – gnm has many more useful features ª for multiplicative models: functional factors, Exp, multiplicity ª other: symmetric interactions, diagonal reference models, eliminate, ... – More details can be found on http://www.warwick.ac.uk/go/dfirth/software/gnm – Available on CRAN http://cran.r-project.org