kb/data/en.wikipedia.org/wiki/Design_matrix-1.md

13 KiB
Raw Blame History

title chunk source category tags date_saved instance
Design matrix 2/2 https://en.wikipedia.org/wiki/Design_matrix reference science, encyclopedia 2026-05-05T09:49:58.034133+00:00 kb-cron
        [
        
          
            
              
                y
                
                  1
                
              
            
          
          
            
              
                y
                
                  2
                
              
            
          
          
            
              
                y
                
                  3
                
              
            
          
          
            
              
                y
                
                  4
                
              
            
          
          
            
              
                y
                
                  5
                
              
            
          
          
            
              
                y
                
                  6
                
              
            
          
          
            
              
                y
                
                  7
                
              
            
          
        
        ]
      
    
    =
    
      
        [
        
          
            
              1
            
            
              0
            
            
              0
            
          
          
            
              1
            
            
              0
            
            
              0
            
          
          
            
              1
            
            
              0
            
            
              0
            
          
          
            
              0
            
            
              1
            
            
              0
            
          
          
            
              0
            
            
              1
            
            
              0
            
          
          
            
              0
            
            
              0
            
            
              1
            
          
          
            
              0
            
            
              0
            
            
              1
            
          
        
        ]
      
    
    
      
        [
        
          
            
              
                μ
                
                  1
                
              
            
          
          
            
              
                μ
                
                  2
                
              
            
          
          
            
              
                μ
                
                  3
                
              
            
          
        
        ]
      
    
    +
    
      
        [
        
          
            
              
                ε
                
                  1
                
              
            
          
          
            
              
                ε
                
                  2
                
              
            
          
          
            
              
                ε
                
                  3
                
              
            
          
          
            
              
                ε
                
                  4
                
              
            
          
          
            
              
                ε
                
                  5
                
              
            
          
          
            
              
                ε
                
                  6
                
              
            
          
          
            
              
                ε
                
                  7
                
              
            
          
        
        ]
      
    
  

{\displaystyle {\begin{bmatrix}y_{1}\\y_{2}\\y_{3}\\y_{4}\\y_{5}\\y_{6}\\y_{7}\end{bmatrix}}={\begin{bmatrix}1&0&0\\1&0&0\\1&0&0\\0&1&0\\0&1&0\\0&0&1\\0&0&1\end{bmatrix}}{\begin{bmatrix}\mu _{1}\\\mu _{2}\\\mu _{3}\end{bmatrix}}+{\begin{bmatrix}\varepsilon _{1}\\\varepsilon _{2}\\\varepsilon _{3}\\\varepsilon _{4}\\\varepsilon _{5}\\\varepsilon _{6}\\\varepsilon _{7}\end{bmatrix}}}

In this model

      μ
      
        i
      
    
  

{\displaystyle \mu _{i}}

represents the mean of the

    i
  

{\displaystyle i}

th group.

=== One-way ANOVA (offset from reference group) === The ANOVA model could be equivalently written as each group parameter

      τ
      
        i
      
    
  

{\displaystyle \tau _{i}}

being an offset from some overall reference. Typically this reference point is taken to be one of the groups under consideration. This makes sense in the context of comparing multiple treatment groups to a control group and the control group is considered the "reference". In this example, group 1 was chosen to be the reference group. As such the model to be fit is

      y
      
        i
        j
      
    
    =
    μ
    +
    
      τ
      
        i
      
    
    +
    
      ε
      
        i
        j
      
    
  

{\displaystyle y_{ij}=\mu +\tau _{i}+\varepsilon _{ij}}

with the constraint that

      τ
      
        1
      
    
  

{\displaystyle \tau _{1}}

is zero.

        [
        
          
            
              
                y
                
                  1
                
              
            
          
          
            
              
                y
                
                  2
                
              
            
          
          
            
              
                y
                
                  3
                
              
            
          
          
            
              
                y
                
                  4
                
              
            
          
          
            
              
                y
                
                  5
                
              
            
          
          
            
              
                y
                
                  6
                
              
            
          
          
            
              
                y
                
                  7
                
              
            
          
        
        ]
      
    
    =
    
      
        [
        
          
            
              1
            
            
              0
            
            
              0
            
          
          
            
              1
            
            
              0
            
            
              0
            
          
          
            
              1
            
            
              0
            
            
              0
            
          
          
            
              1
            
            
              1
            
            
              0
            
          
          
            
              1
            
            
              1
            
            
              0
            
          
          
            
              1
            
            
              0
            
            
              1
            
          
          
            
              1
            
            
              0
            
            
              1
            
          
        
        ]
      
    
    
      
        [
        
          
            
              μ
            
          
          
            
              
                τ
                
                  2
                
              
            
          
          
            
              
                τ
                
                  3
                
              
            
          
        
        ]
      
    
    +
    
      
        [
        
          
            
              
                ε
                
                  1
                
              
            
          
          
            
              
                ε
                
                  2
                
              
            
          
          
            
              
                ε
                
                  3
                
              
            
          
          
            
              
                ε
                
                  4
                
              
            
          
          
            
              
                ε
                
                  5
                
              
            
          
          
            
              
                ε
                
                  6
                
              
            
          
          
            
              
                ε
                
                  7
                
              
            
          
        
        ]
      
    
  

{\displaystyle {\begin{bmatrix}y_{1}\\y_{2}\\y_{3}\\y_{4}\\y_{5}\\y_{6}\\y_{7}\end{bmatrix}}={\begin{bmatrix}1&0&0\\1&0&0\\1&0&0\\1&1&0\\1&1&0\\1&0&1\\1&0&1\end{bmatrix}}{\begin{bmatrix}\mu \\\tau _{2}\\\tau _{3}\end{bmatrix}}+{\begin{bmatrix}\varepsilon _{1}\\\varepsilon _{2}\\\varepsilon _{3}\\\varepsilon _{4}\\\varepsilon _{5}\\\varepsilon _{6}\\\varepsilon _{7}\end{bmatrix}}}

In this model

    μ
  

{\displaystyle \mu }

is the mean of the reference group and

      τ
      
        i
      
    
  

{\displaystyle \tau _{i}}

is the difference from group

    i
  

{\displaystyle i}

to the reference group.

      τ
      
        1
      
    
  

{\displaystyle \tau _{1}}

is not included in the matrix because its difference from the reference group (itself) is necessarily zero.

== See also == Moment matrix Projection matrix Jacobian matrix and determinant Scatter matrix Gram matrix Vandermonde matrix

== References ==

== Further reading == Verbeek, Albert (1984). "The Geometry of Model Selection in Regression". In Dijkstra, Theo K. (ed.). Misspecification Analysis. New York: Springer. pp. 2036. ISBN 0-387-13893-5.