Pritish Kakodkar - 3 months ago 6

R Question

I have an outcome variable, say Y and a list of 100 dimensions that could affect Y (say X1...X100).

After running my

`glm`

Answer

You can get access the pvalues of the glm result through the function "summary". The last column of the coefficients matrix is called "Pr(>|t|)" and holds the pvalues of the factors used in the model.

Here's an example:

```
#x is a 10 x 3 matrix
x = matrix(rnorm(3*10), ncol=3)
y = rnorm(10)
res = glm(y~x)
#ignore the intercept pval
summary(res)$coeff[-1,4] < 0.05
```