[R] p-values from VGAM function vglm

David Winsemius dwinsemius at comcast.net
Sun Jun 7 04:27:03 CEST 2009


On Jun 6, 2009, at 4:13 AM, Emmanuel Charpentier wrote:

> Dear David,
>
> Le vendredi 05 juin 2009 à 16:18 -0400, David Winsemius a écrit :
>> On Jun 5, 2009, at 3:15 PM, Steven Matthew Anderson wrote:
>>
>>> Anyone know how to get p-values for the t-values from the
>>> coefficients produced in vglm?
>>> Attached is the code and output — see comment added to output to
>>> show where I need p-values
>>>
>>>
>>> +     print(paste("**********   Using VGAM function gamma2
>>> **********"))
>>> +     modl2<-
>>> vglm(MidPoint~Count,gamma2,data=modl.subset,trace=TRUE,crit="c")
>>> +     print(coef(modl2,matrix=TRUE))
>>> +     print(summary(modl2))
>>>
>>>
>>> [1] "**********   Using VGAM function gamma2 **********"
>>> VGLM    linear loop  1 :  coefficients =
>>> 0.408464609241,  3.255887520104, -0.000220585671
>>> VGLM    linear loop  2 :  coefficients =
>>> 2.34723239e-01,  1.28969691e+00, -4.52393778e-05
>>> VGLM    linear loop  3 :  coefficients =
>>> 2.19500481e-01,  1.92534895e+00, -3.02160949e-05
>>> VGLM    linear loop  4 :  coefficients =
>>> 2.19383151e-01,  2.26845910e+00, -3.00838664e-05
>>> VGLM    linear loop  5 :  coefficients =
>>> 2.19383045e-01,  2.34645688e+00, -3.00836087e-05
>>> VGLM    linear loop  6 :  coefficients =
>>> 2.19383045e-01,  2.34977070e+00, -3.00836082e-05
>>> VGLM    linear loop  7 :  coefficients =
>>> 2.19383045e-01,  2.34977637e+00, -3.00836082e-05
>>> VGLM    linear loop  8 :  coefficients =
>>> 2.19383045e-01,  2.34977637e+00, -3.00836082e-05
>>>                 log(mu) log(shape)
>>> (Intercept)  2.193830e-01   2.349776
>>> Count       -3.008361e-05   0.000000
>>>
>>> Call:
>>> vglm(formula = MidPoint ~ Count, family = gamma2, data =  
>>> modl.subset,
>>>   trace = TRUE, crit = "c")
>>>
>>> Pearson Residuals:
>>>              Min       1Q   Median      3Q     Max
>>> log(mu)    -1.7037 -0.82997 0.072275 0.78520 1.72834
>>> log(shape) -2.5152 -0.32448 0.254698 0.58772 0.70678
>>>
>>>
>>> ######### NEED P-VALUES HERE #########
>>
>> Perhaps:
>>
>> dt(summary( modl2 )@coef3[ , 3], 1)
>
> ???
>
> 1) dt() is the density. didn't you mean pt() ?

Quite right.

>
> 2) I'd rather quote 2*min(pt(), 1-pt()) ("bilateral tests", y'know...)
> 3) The real hitch here is : what are the right DoF ? I do not think
> there is an easy answer to *this* one...

Which may be the reason that the summary method was not designed that  
way?

>
>
> 					Emmanuel Charpentier
>
>>>
>>> Coefficients:
>>>                   Value Std. Error  t value
>>> (Intercept):1  2.1938e-01 5.2679e-02  4.16455
>>> (Intercept):2  2.3498e+00 1.7541e-01 13.39574
>>> Count         -3.0084e-05 8.9484e-05 -0.33619
>>>
>>> Number of linear predictors:  2
>>>
>>> Names of linear predictors: log(mu), log(shape)
>>>
>>> Dispersion Parameter for gamma2 family:   1
>>>
>>> Log-likelihood: -26.39268 on 123 degrees of freedom
>>>
>>> Number of Iterations: 8
>>>
>>>
>>> Steven Matthew Anderson
>>>
>>> Anderson Research, LLC
>>> Statistical Programming and Analysis
>>> SAS (R) Certified Professional
>>> AdAstra69 at mac.com
>

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list