A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cran.rstudio.com/web/packages/SpatialTools/../Rcpp/../vcpen/vignettes/vcpen.html below:

Penalized Variance Components

Sample dataset

Below provides snapshots of an example dataset. The response is the outcome variable, covmat is a matrix of adjusting covariates, and dose is a matrix of the dose of a minor allele for SNPs (dose values of 0, 1, 2). The doseinfo illustrates how the SNPs (columns of dose) map into groups, for creating kernel matrices for each group. A kernel matrix for n subjects is an nxn matrix that measures similarity of the dose values for each pair of subjects.

[1] "covmat"   "dose"     "doseinfo" "response"
  snp1 snp2 snp3 snp4 snp5 snp6 snp7 snp8 snp9 snp10 snp11 snp12 snp13 snp14
1    0    0    0    0    1    1    1    0    0     1     1     0     0     1
2    1    0    0    0    0    1    0    0    0     0     2     0     0     1
3    0    0    0    0    1    0    0    0    0     1     0     0     0     0
4    1    0    0    0    1    0    0    1    1     0     0     0     0     0
5    0    0    0    0    0    1    0    0    0     1     0     0     1     0
6    0    0    0    0    1    0    0    0    0     0     1     0     0     0
  snp15 snp16 snp17 snp18 snp19 snp20 snp21 snp22 snp23 snp24 snp25 snp26 snp27
1     1     0     1     1     0     1     2     0     0     0     0     1     0
2     2     1     0     1     0     1     0     0     0     0     0     0     0
3     0     0     0     0     0     0     0     1     1     1     0     1     0
4     0     1     0     0     1     1     0     0     0     0     0     0     0
5     0     0     0     0     0     0     1     0     0     1     0     1     0
6     1     0     0     0     0     0     0     1     0     0     1     0     0
  snp28 snp29 snp30 snp31 snp32 snp33 snp34 snp35 snp36 snp37 snp38 snp39 snp40
1     0     0     0     0     0     1     0     0     0     0     0     0     1
2     0     0     1     0     0     0     1     0     0     0     0     1     0
3     0     1     0     0     0     0     0     0     0     0     1     1     0
4     1     1     0     0     0     0     0     0     0     0     0     1     0
5     0     0     0     0     0     1     1     0     0     0     0     0     1
6     0     0     0     0     0     0     0     1     0     0     0     0     0
  snp41 snp42 snp43 snp44 snp45 snp46 snp47 snp48 snp49 snp50 snp51 snp52 snp53
1     1     0     1     0     1     1     0     1     1     0     0     0     0
2     0     1     0     1     0     1     0     1     0     0     0     0     0
3     0     1     0     0     0     1     1     0     0     0     0     0     0
4     0     0     0     0     0     1     0     0     0     0     0     1     0
5     0     1     0     1     0     0     0     1     0     1     1     1     0
6     0     1     0     0     1     0     1     0     0     0     0     2     0
  snp54 snp55 snp56 snp57 snp58 snp59 snp60 snp61 snp62 snp63 snp64 snp65 snp66
1     0     0     1     0     0     0     0     0     0     0     0     0     0
2     0     0     0     0     0     1     0     0     1     0     0     1     0
3     0     0     1     0     0     0     0     0     1     0     0     0     0
4     0     0     0     0     1     0     1     0     1     0     0     1     0
5     0     0     0     0     0     0     0     0     1     0     0     0     0
6     1     0     1     0     1     0     0     0     0     2     0     1     0
  snp67 snp68 snp69 snp70
1     0     0     0     0
2     0     1     0     0
3     1     0     0     0
4     0     0     0     0
5     0     0     0     0
6     0     0     0     0
  index vcname
1     1    vc1
2     1    vc1
3     1    vc1
4     1    vc1
5     1    vc1
6     1    vc1
 [1]  0.54166685  0.07233516 -1.03718603 -1.16407584  1.17964672  0.14994286
 [7]  1.82625006 -2.83793412 -0.18631904  1.53431587
Make kernel matrices

The example below illustrates how to loop over groups (indicated by doseinfo) to create linear kernel matrices for each group. Note that the number of variance components is the number of groups plus 1, because the last group is for the residual variance component, which will have a kernel matrix that is the identity matrix.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4