Skip to content
This repository has been archived by the owner on Oct 15, 2021. It is now read-only.

How to input covariate in the model at hiblup? #4

Open
LBreeder opened this issue Feb 2, 2021 · 1 comment
Open

How to input covariate in the model at hiblup? #4

LBreeder opened this issue Feb 2, 2021 · 1 comment

Comments

@LBreeder
Copy link

LBreeder commented Feb 2, 2021

_Hello dear phDs

I am studing to use HIBLUP package to estimate dominance effect. but How can input the covariate in the model at hiblup.
I can find it in the manual.
X <- model.matrix(~as.factor(Sex), data = pheno) fixed effects
if 'Sex' is fitted as fixed effect, please convert the column to
factor by 'as.factor(Sex)' if 'Sex' is fitted as covariates, please
convert the column to numeric by 'as.numeric(as.character(Sex))'

I wish to input the fixed effect and covariates in the model

Thank you in advances_

@hyacz
Copy link
Contributor

hyacz commented Mar 28, 2021

If you want to add CV1 and CV2 as covariates and F1 and F2 as fixed effects, you can use the following code. Note that you need to ensure that the types of CV1 and CV2 are numeric.

X <- phe[, c("CV1", "CV2"), drop = FALSE]
X <- cbind(X, model.matrix(~ as.factor(F1) + as.factor(F2), data = phe))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants