Extracting Beta, SE and P-Value from GLM model
1
0
Entering edit mode
21 months ago
Agamemnon ▴ 80

Hi there,

I want to extract beta from a glm model analysis, my variables are as follows:

test.data

ID  Phenotype           snp
1442211 0.947595614262281   2
1501431 0.828960485290687   2
1676115 1.43030605455755    2
1700393 0.77901178220667    2
2028223 0.981493321966468   2
2075852 0.734295870666147   2
2601302 0.829567302722706   2
2764237 0.771672795944737   2
2945830 0.883541977719076   2
3298196 0.943926904715075   2
3526834 0.732810576113019   2
3631754 0.801726287522778   2
3658601 1.04733798012754    2
3935118 0.765959341809356   2
3957833 1.05461197940193    2
3975539 1.17690566037736    2
4170014 0.80678640233671    2
5016911 1.18594231307757    2
5140477 0.770128136053784   2
5255187 1.34567744394334    2
5437481 0.790346873573711   2
5659818 1.00715236762145    2
1002613 0.769225441532956   1
1002726 0.784628007708894   1
1006494 0.859776904196516   1
1006695 0.723499071590675   1
1006712 0.978525656704006   1
1011518 1.67284614392017    1
1013652 0.970961197058078   1
1013817 0.793608698534774   1

My glm formula looks as follows which gives the following results:

Call:
glm(formula = phenotype ~ snp, family = gaussian(), data = test.data)

Deviance Residuals: 
     Min        1Q    Median        3Q       Max  
-0.22063  -0.15915  -0.09593   0.06366   0.72871  

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.951188   0.171248   5.554 6.11e-06 ***
snp         -0.007054   0.095730  -0.074    0.942    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for gaussian family taken to be 0.05376381)

    Null deviance: 1.5057  on 29  degrees of freedom
Residual deviance: 1.5054  on 28  degrees of freedom
AIC: 1.3719

Number of Fisher Scoring iterations: 2

I would like to extract the beta, and double check which value it is?

I am assuming it is -0.007054?

Thanks

beta glm r • 1.3k views
ADD COMMENT
1
Entering edit mode
21 months ago
LChart 3.9k

I use summary(model)$coefficients to get the coefficient table.

ADD COMMENT

Login before adding your answer.

Traffic: 1441 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6