View source: R/predictSNPreg.R
predictSNPreg | R Documentation |
This functions predicts fitted values for newly entered data from a fitted "SNPlm" or "SNPinter" object.
predictSNPreg(x, newz, newX)
x |
an "SNPlm"/"SNPinter" object obtained by |
newz |
matrix of new values for z at which predictions are to be made. |
newX |
matrix of new values for X at which predictions are to be made. |
predicted.values: the predicted mean values.
See Also as SNPlm
, SNPinter
.
library(FunctanSNP) n <- 300 m <- 30 simdata1 <- simData1(n, m, seed = 123) SNPlmres <- SNPlm(y = simdata1$y[1:200], z = simdata1$z[1:200, ], location = simdata1$location, X = simdata1$X[1:200, ], type1 = "Bspline", type2 = "Bspline", nbasis1 = 5, nbasis2 = 5, params1 = 4, params2 = 4, intercept = FALSE, Plot = FALSE) predict.values1 <- predictSNPreg(x = SNPlmres, newz = simdata1$z[-(1:200), ], newX = simdata1$X[-(1:200), ]) simdata2 <- simData2(n, m, seed = 123) lambda1 <- 0.05 lambda2 <- sqrt(3)*lambda1 eta <- 0 SNPinterres <- SNPinter(y = simdata2$y[1:200], z = simdata2$z[1:200, ], location = simdata2$location, X = simdata2$X[1:200, ], lambda1, lambda2, eta, type1 = "Bspline", nbasis1 = 5, params1 = 4, Bsplines = 5, norder = 4, intercept = TRUE, eps = 1e-2, maxstep = 1e2, Plot = FALSE) predict.values2 <- predictSNPreg(x = SNPinterres, newz = simdata2$z[-(1:200), ], newX = simdata2$X[-(1:200), ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.