Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible issue with categorical variables used as covariates? #435

Open
brettva opened this issue Jul 30, 2023 · 0 comments
Open

possible issue with categorical variables used as covariates? #435

brettva opened this issue Jul 30, 2023 · 0 comments

Comments

@brettva
Copy link

brettva commented Jul 30, 2023

I am trying to run the following step1 using SAIGE_1.2.0:

fitNULLGLMM(plinkFile = plinkFile,
            phenoFile = phenoFile,
            phenoCol = phenotype,
            traitType = traitType,
            invNormalize = invNormalize),
            covarColList = covarCols,
            sampleIDColinphenoFile = 'IID',
            nThreads = as.integer(cpus),
            outputPrefix = results_dir,
            IsOverwriteVarianceRatioFile=TRUE)

where covarCols is

c("array","age","PC1_EUR","PC2_EUR","PC3_EUR","PC4_EUR","SNPSEX")

the array col is a categorical variable with string values "MGI", "MGI_1_1", "MGI_1_2","MGI_1_3"

When running step 1, I can see these are interpreted as levels -1 with columns with arrayMGI_1_1, arrayMGI_1_2, arrayMGI_1_3, buy I get error :

Error in model.frame.default(object, data, xlev = xlev) :
  invalid type (closure) for variable 'array'

This seems to be specific to the the categorical variable , if I recode the array column numerically the issue goes away. I have tried recoding other columns as categorical and see the issue appear there as well. Am I doing something silly on my end or is this a bug? Thanks!

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

No branches or pull requests

1 participant