User:Timothee Flutre/Notebook/Postdoc/2011/06/28
From OpenWetWare
(→Entry title: first version) 
(→Calculate OLS estimates with summary statistics for simple linear regression: add std err of beta) 

Line 45:  Line 45:  
</math>  </math>  
  Let's now define 4 summary statistics:  +  Let's now define 4 summary statistics, very easy to compute: 
<math>\bar{y} = \frac{1}{n} \sum_{i=1}^n y_i</math>  <math>\bar{y} = \frac{1}{n} \sum_{i=1}^n y_i</math>  
Line 54:  Line 54:  
<math>g^T y = \sum_{i=1}^n g_i y_i</math>  <math>g^T y = \sum_{i=1}^n g_i y_i</math>  
+  
+  This allows to obtain the estimate of the effect size only by having the summary statistics available:  
<math>\hat{\beta} = \frac{g^T y  n \bar{g} \bar{y}}{g^T g  n \bar{g}^2}</math>  <math>\hat{\beta} = \frac{g^T y  n \bar{g} \bar{y}}{g^T g  n \bar{g}^2}</math>  
+  
+  The same works for the estimate of the standard deviation of the errors:  
+  
+  <math>\hat{\sigma}^2 = \frac{1}{nr}(y  X\hat{\theta})^T(y  X\hat{\theta})</math>  
+  
+  We can also benefit from this for the standard error of the parameters:  
+  
+  <math>V(\hat{\theta}) = \hat{\sigma}^2 (X^T X)^{1}</math>  
+  
+  <math>V(\hat{\theta}) = \hat{\sigma}^2 \frac{1}{n g^T g  n^2 \bar{g}^2}  
+  \begin{bmatrix} g^Tg & n\bar{g} \\ n\bar{g} & n \end{bmatrix}  
+  </math>  
+  
+  <math>V(\hat{\beta}) = \frac{\hat{\sigma}^2}{g^Tg  n\bar{g}^2}</math>  
<! ##### DO NOT edit below this line unless you know what you are doing. ##### >  <! ##### DO NOT edit below this line unless you know what you are doing. ##### > 
Revision as of 17:17, 28 March 2012
Project name  Main project page Next entry 
Calculate OLS estimates with summary statistics for simple linear regressionWe obtained data from n individuals. Let be the (quantitative) phenotypes (eg. expression level at a given gene), and the genotypes at a given SNP. We want to assess the linear relationship between phenotype and genotype. For this with use a simple linear regression: y_{i} = μ + βx_{i} + ε_{i} with and for In vectormatrix notation: y = Xθ + ε with and θ^{T} = (μ,β) Here is the ordinaryleastsquare (OLS) estimator of θ:
Let's now define 4 summary statistics, very easy to compute:
This allows to obtain the estimate of the effect size only by having the summary statistics available:
The same works for the estimate of the standard deviation of the errors:
We can also benefit from this for the standard error of the parameters:
