This holds output from a call to zlm. Many methods are defined to operate on it. See below.

# S4 method for ZlmFit,CoefficientHypothesis
lrTest(object, hypothesis, ...)

# S4 method for ZlmFit,Hypothesis
lrTest(object, hypothesis, ...)

# S4 method for ZlmFit,matrix
lrTest(object, hypothesis, ...)

# S4 method for ZlmFit,CoefficientHypothesis
waldTest(object, hypothesis)

# S4 method for ZlmFit,Hypothesis
waldTest(object, hypothesis)

# S4 method for ZlmFit
coef(object, which, ...)

# S4 method for ZlmFit
vcov(object, which, ...)

# S4 method for ZlmFit
se.coef(object, which, ...)

Arguments

object

ZlmFit

hypothesis

call to Hypothesis or CoefficientHypothesis or a matrix giving such contrasts.

...

ignored

which

character vector, one of "C" (continuous) or "D" (discrete) specifying which component should be returned

Value

see "Methods (by generic)"

Methods (by generic)

  • lrTest: Returns an array with likelihood-ratio tests on contrasts defined using CoefficientHypothesis().

  • lrTest: Returns an array with likelihood-ratio tests specified by Hypothesis, which is a Hypothesis.

  • lrTest: Returns an array with likelihood-ratio tests specified by Hypothesis, which is a contrast matrix.

  • waldTest: Returns an array with Wald Tests on contrasts defined using CoefficientHypothesis().

  • waldTest: Returns an array with Wald Tests on contrasts defined in Hypothesis()

  • coef: Returns the matrix of coefficients for component which.

  • vcov: Returns an array of variance/covariance matrices for component which.

  • se.coef: Returns a matrix of standard error estimates for coefficients on component which.

Slots

coefC

matrix of continuous coefficients

coefD

matrix of discrete coefficients

vcovC

array of variance/covariance matrices for coefficients

vcovD

array of variance/covariance matrices for coefficients

LMlike

the LmWrapper object used

sca

the SingleCellAssay object used

deviance

matrix of deviances

loglik

matrix of loglikelihoods

df.null

matrix of null (intercept only) degrees of freedom

df.resid

matrix of residual DOF

dispersion

matrix of dispersions (after shrinkage)

dispersionNoShrink

matrix of dispersion (before shrinkage)

priorDOF

shrinkage weight in terms of number of psuedo-obs

priorVar

shrinkage target

converged

output that may optionally be set by the underlying modeling function

hookOut

a list of length ngenes containing output from a hook function, if zlm was called with one

exprs_values

`character` or `integer` with the `assay` used.

See also

zlm summary,ZlmFit-method

Examples

data(vbetaFA)
zlmVbeta <- zlm(~ Stim.Condition+Population, subset(vbetaFA, ncells==1)[1:10,])
#> 
#> Done!
#Coefficients and standard errors
coef(zlmVbeta, 'D')
#>        (Intercept) Stim.ConditionUnstim PopulationCD154+VbetaUnresponsive
#> B3GAT1  -4.1795641           0.63282096                      -1.162182250
#> BAX     -0.9330077           0.02794714                      -0.162052054
#> BCL2    -3.9226304          -2.20112377                       1.332228054
#> CCL2    -3.8309742           0.54760417                       0.147212758
#> CCL3    -2.3287704          -1.94930881                      -0.567152079
#> CCL4    -2.9386008          -1.06755978                      -0.003368973
#> CCL5    -1.2350667           0.09455937                      -0.484094746
#> CCR2    -4.1050742           1.37877860                       1.504033462
#> CCR4    -0.1126440          -0.21758890                      -0.839917265
#> CCR5    -2.7417205          -1.20694083                       0.521925468
#>        PopulationCD154-VbetaResponsive PopulationCD154-VbetaUnresponsive
#> B3GAT1                     -1.14875333                       -0.16659777
#> BAX                         0.45518519                       -0.46291603
#> BCL2                       -1.29400053                       -0.39116499
#> CCL2                        0.84204812                        0.14680392
#> CCL3                       -0.14648827                       -0.60189062
#> CCL4                        0.02118041                       -1.25132594
#> CCL5                       -0.65755684                       -0.41313077
#> CCR2                        0.40289360                        0.39925195
#> CCR4                       -0.24604817                       -0.68742757
#> CCR5                       -0.16103855                        0.02099718
#>        PopulationVbetaResponsive PopulationVbetaUnresponsive
#> B3GAT1                -1.8211123                 -0.53512412
#> BAX                    0.5582425                  0.53846239
#> BCL2                   2.0919143                  1.91118512
#> CCL2                  -0.7797822                 -2.02874891
#> CCL3                  -0.7669146                 -2.46844725
#> CCL4                  -2.1491640                 -2.15309456
#> CCL5                  -0.8123545                 -0.94068157
#> CCR2                  -0.4731219                  0.18547502
#> CCR4                  -0.1364576                 -0.01272681
#> CCR5                  -0.5077805                 -0.12742084
coef(zlmVbeta, 'C')
#>        (Intercept) Stim.ConditionUnstim PopulationCD154+VbetaUnresponsive
#> B3GAT1    18.19441           -1.7969063                                NA
#> BAX       17.67008           -0.6534516                        -0.2356154
#> BCL2      18.73554            1.3286670                        -1.3753715
#> CCL2      23.94679           -7.3355989                        -3.6985974
#> CCL3      19.86182                   NA                         3.2750181
#> CCL4      19.54785                   NA                         1.2579223
#> CCL5      20.07363            0.4504418                        -0.2026483
#> CCR2      15.27429           -1.2269270                         4.1759840
#> CCR4      18.03446           -0.3702826                        -0.1011834
#> CCR5      16.28993            0.9461661                         1.1537964
#>        PopulationCD154-VbetaResponsive PopulationCD154-VbetaUnresponsive
#> B3GAT1                              NA                        -0.5500307
#> BAX                        -0.19649762                        -0.2783088
#> BCL2                                NA                        -3.1850947
#> CCL2                       -7.04188444                        -3.9220153
#> CCL3                       -0.04812137                        -0.6043503
#> CCL4                        2.77190815                        -2.5532715
#> CCL5                       -0.84757938                        -1.5303864
#> CCR2                        3.19304135                         4.0151403
#> CCR4                       -0.57583680                        -0.7602052
#> CCR5                       -0.51211945                        -0.6646556
#>        PopulationVbetaResponsive PopulationVbetaUnresponsive
#> B3GAT1                        NA                          NA
#> BAX                  -0.04213554                 -0.01140701
#> BCL2                 -1.58527659                 -2.32150932
#> CCL2                          NA                          NA
#> CCL3                  0.45944273                          NA
#> CCL4                          NA                          NA
#> CCL5                 -1.61445447                 -1.33608326
#> CCR2                  3.31403666                  2.07650762
#> CCR4                 -0.26166401                 -0.75331686
#> CCR5                 -1.26236131                 -1.52747203
se.coef(zlmVbeta, 'C')
#>         
#> X1       (Intercept) Stim.ConditionUnstim PopulationCD154+VbetaUnresponsive
#>   B3GAT1   1.1195139            1.9390550                                NA
#>   BAX      0.2289293            0.2625570                         0.4158706
#>   BCL2     1.1852624            1.2983899                         1.3686231
#>   CCL2     2.5224874            4.3690763                         4.3690763
#>   CCL3     1.4009323                   NA                         3.1325799
#>   CCL4     1.7441805                   NA                         3.2630629
#>   CCL5     0.4951370            1.0038683                         1.0106941
#>   CCR2     1.1047933            1.2757054                         1.2757054
#>   CCR4     0.2983985            0.4372988                         0.6361878
#>   CCR5     0.6656093            2.1048414                         0.9984140
#>         
#> X1       PopulationCD154-VbetaResponsive PopulationCD154-VbetaUnresponsive
#>   B3GAT1                              NA                         1.9390550
#>   BAX                          0.3643741                         0.3574157
#>   BCL2                                NA                         1.6762142
#>   CCL2                         3.5673358                         3.5673358
#>   CCL3                         2.6825812                         2.4264860
#>   CCL4                         3.2630629                         4.2723522
#>   CCL5                         1.0847908                         0.7768348
#>   CCR2                         1.5624136                         1.3530899
#>   CCR4                         0.5532457                         0.4774376
#>   CCR5                         1.2452410                         0.9413137
#>         
#> X1       PopulationVbetaResponsive PopulationVbetaUnresponsive
#>   B3GAT1                        NA                          NA
#>   BAX                    0.3211103                   0.3241627
#>   BCL2                   1.2670988                   1.2983899
#>   CCL2                          NA                          NA
#>   CCL3                   3.1325799                          NA
#>   CCL4                          NA                          NA
#>   CCL5                   1.0362222                   0.9807059
#>   CCR2                   1.8596442                   1.5624136
#>   CCR4                   0.4777267                   0.4725825
#>   CCR5                   1.6304032                   1.0869354
#Test for a Population effect by dropping the whole term (a 5 degree of freedom test)
lrTest(zlmVbeta, 'Population')
#> Refitting on reduced model...
#> 
#> Done!
#> , , metric = lambda
#> 
#>         test.type
#> primerid      cont      disc    hurdle
#>   B3GAT1  0.000000  3.293892  3.293892
#>   BAX     1.072472 10.728081 11.800553
#>   BCL2    5.443797 20.567934 26.011731
#>   CCL2    4.103765  4.775242  8.879007
#>   CCL3    1.523584  7.006491  8.530076
#>   CCL4    1.516648  8.444875  9.961523
#>   CCL5    5.572644  5.389674 10.962318
#>   CCR2   12.540757  4.640800 17.181557
#>   CCR4    4.607460  8.728194 13.335653
#>   CCR5    7.136405  1.526627  8.663031
#> 
#> , , metric = df
#> 
#>         test.type
#> primerid cont disc hurdle
#>   B3GAT1    0    5      5
#>   BAX       5    5     10
#>   BCL2      4    5      9
#>   CCL2      3    5      8
#>   CCL3      4    5      9
#>   CCL4      3    5      8
#>   CCL5      5    5     10
#>   CCR2      5    5     10
#>   CCR4      5    5     10
#>   CCR5      5    5     10
#> 
#> , , metric = Pr(>Chisq)
#> 
#>         test.type
#> primerid       cont         disc     hurdle
#>   B3GAT1 1.00000000 0.6547769674 0.65477697
#>   BAX    0.95651117 0.0570459966 0.29862654
#>   BCL2   0.24471407 0.0009773063 0.00203398
#>   CCL2   0.25047521 0.4439211826 0.35260548
#>   CCL3   0.82245576 0.2201579879 0.48173135
#>   CCL4   0.67843337 0.1333623010 0.26773693
#>   CCL5   0.35004597 0.3701952302 0.36046135
#>   CCR2   0.02808429 0.4612686366 0.07044188
#>   CCR4   0.46563569 0.1204092082 0.20550576
#>   CCR5   0.21069179 0.9099767975 0.56435354
#> 
#> attr(,"test")
#> [1] "Population"
#Test only if the VbetaResponsive cells differ from the baseline group
lrTest(zlmVbeta, CoefficientHypothesis('PopulationVbetaResponsive'))
#> Refitting on reduced model...
#> 
#> Done!
#> , , metric = lambda
#> 
#>         test.type
#> primerid       cont      disc     hurdle
#>   B3GAT1 0.00000000 2.2974635  2.2974635
#>   BAX    0.01776885 2.5081546  2.5259234
#>   BCL2   1.80508046 9.4881861 11.2932665
#>   CCL2   0.00000000 0.6678630  0.6678630
#>   CCL3   0.02425584 1.1530015  1.1772574
#>   CCL4   0.00000000 3.8914009  3.8914009
#>   CCL5   2.54893181 3.3702326  5.9191644
#>   CCR2   3.99053248 0.1406114  4.1311439
#>   CCR4   0.30752656 0.1884803  0.4960069
#>   CCR5   0.73461509 0.3702349  1.1048500
#> 
#> , , metric = df
#> 
#>         test.type
#> primerid cont disc hurdle
#>   B3GAT1    0    1      1
#>   BAX       1    1      2
#>   BCL2      1    1      2
#>   CCL2      0    1      1
#>   CCL3      1    1      2
#>   CCL4      0    1      1
#>   CCL5      1    1      2
#>   CCR2      1    1      2
#>   CCR4      1    1      2
#>   CCR5      1    1      2
#> 
#> , , metric = Pr(>Chisq)
#> 
#>         test.type
#> primerid      cont        disc      hurdle
#>   B3GAT1 1.0000000 0.129585466 0.129585466
#>   BAX    0.8939563 0.113258489 0.282815165
#>   BCL2   0.1790995 0.002067992 0.003529379
#>   CCL2   1.0000000 0.413797670 0.413797670
#>   CCL3   0.8762357 0.282921705 0.555087964
#>   CCL4   1.0000000 0.048533925 0.048533925
#>   CCL5   0.1103689 0.066384383 0.051840572
#>   CCR2   0.0457566 0.707673921 0.126745777
#>   CCR4   0.5792020 0.664184477 0.780357269
#>   CCR5   0.3913913 0.542876237 0.575552395
#> 
#> attr(,"test")
#> [1] "PopulationVbetaResponsive"
# Test if there is a difference between CD154+/Unresponsive and CD154-/Unresponsive.
# Note that because we parse the expression
# the columns must be enclosed in backquotes
# to protect the \quote{+} and \quote{-} characters.
lrTest(zlmVbeta, Hypothesis('`PopulationCD154+VbetaUnresponsive` -
        `PopulationCD154-VbetaUnresponsive`'))
#> Warning: Some levels contain symbols.  Be careful to escape these names with backticks ('`') when specifying contrasts.
#> Refitting on reduced model...
#> 
#> Done!
#> , , metric = lambda
#> 
#>         test.type
#> primerid        cont        disc     hurdle
#>   B3GAT1 0.000000000  0.19720610  0.1972061
#>   BAX    0.009603320  0.43127916  0.4408825
#>   BCL2   2.004979393  2.88482572  4.8898051
#>   CCL2   0.003581828 -0.10852740 -0.1049456
#>   CCL3   1.389919527 -0.59684167  0.7930779
#>   CCL4   0.695474388  1.22446841  1.9199428
#>   CCL5   1.643474587  0.01090422  1.6543788
#>   CCR2   0.037354159  1.44946742  1.4868216
#>   CCR4   0.977322744  0.13931993  1.1166427
#>   CCR5   3.776168456  0.50849269  4.2846611
#> 
#> , , metric = df
#> 
#>         test.type
#> primerid cont disc hurdle
#>   B3GAT1    0    1      1
#>   BAX       1    1      2
#>   BCL2      1    1      2
#>   CCL2      1    1      2
#>   CCL3      1    1      2
#>   CCL4      1    1      2
#>   CCL5      1    1      2
#>   CCR2      1    1      2
#>   CCR4      1    1      2
#>   CCR5      1    1      2
#> 
#> , , metric = Pr(>Chisq)
#> 
#>         test.type
#> primerid       cont       disc     hurdle
#>   B3GAT1 1.00000000 0.65698552 0.65698552
#>   BAX    0.92193505 0.51136195 0.80216477
#>   BCL2   0.15678342 0.08941768 0.08673459
#>   CCL2   0.95227640 1.00000000 1.00000000
#>   CCL3   0.23841869 1.00000000 0.67264409
#>   CCL4   0.40430856 0.26848550 0.38290384
#>   CCL5   0.19984941 0.91683346 0.43727657
#>   CCR2   0.84674577 0.22861343 0.47548935
#>   CCR4   0.32286067 0.70895803 0.57216874
#>   CCR5   0.05198758 0.47579209 0.11738096
#> 
#> attr(,"test")
#> [1] "Contrast Matrix"
waldTest(zlmVbeta, Hypothesis('`PopulationCD154+VbetaUnresponsive` -
        `PopulationCD154-VbetaUnresponsive`'))
#> Warning: Some levels contain symbols.  Be careful to escape these names with backticks ('`') when specifying contrasts.
#> , , metric = lambda
#> 
#>         test.type
#> primerid        cont         disc      hurdle
#>   B3GAT1          NA 2.632691e-01          NA
#>   BAX    0.009305455 4.373274e-01 0.446632837
#>   BCL2   1.748463371 2.500540e+00 4.249003565
#>   CCL2   0.002614910 1.215898e-07 0.002615031
#>   CCL3   1.278016527 1.692421e-03 1.279708948
#>   CCL4   0.636616606 1.271218e+00 1.907834528
#>   CCL5   1.553679693 1.810976e-02 1.571789452
#>   CCR2   0.025434721 1.431864e+00 1.457299039
#>   CCR4   0.955370495 1.297495e-01 1.085120034
#>   CCR5   3.317281808 5.264420e-01 3.843723848
#> 
#> , , metric = df
#> 
#>         test.type
#> primerid cont disc hurdle
#>   B3GAT1    1    1      2
#>   BAX       1    1      2
#>   BCL2      1    1      2
#>   CCL2      1    1      2
#>   CCL3      1    1      2
#>   CCL4      1    1      2
#>   CCL5      1    1      2
#>   CCR2      1    1      2
#>   CCR4      1    1      2
#>   CCR5      1    1      2
#> 
#> , , metric = Pr(>Chisq)
#> 
#>         test.type
#> primerid       cont      disc    hurdle
#>   B3GAT1         NA 0.6078831        NA
#>   BAX    0.92315144 0.5084152 0.7998617
#>   BCL2   0.18607002 0.1138073 0.1194925
#>   CCL2   0.95921700 0.9997218 0.9986933
#>   CCL3   0.25826815 0.9671850 0.5273692
#>   CCL4   0.42493864 0.2595383 0.3852290
#>   CCL5   0.21259304 0.8929499 0.4557118
#>   CCR2   0.87328861 0.2314604 0.4825602
#>   CCR4   0.32835604 0.7186919 0.5812583
#>   CCR5   0.06855509 0.4681066 0.1463342
#>