# Logistic regression on remote servers

**URL:** <https://discuss.hail.is/t/logistic-regression-on-remote-servers/1735>\
**Category:** Hail Query & hailctl\
**Created:** [October 14, 2020, 3:36am UTC](https://discuss.hail.is/t/logistic-regression-on-remote-servers/1735 "2020-10-14T03:36:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@Stephen](https://discuss.hail.is/u/Stephen)\
**Post date:** [October 14, 2020, 3:36am UTC](https://discuss.hail.is/t/logistic-regression-on-remote-servers/1735/1 "2020-10-14T03:36:21Z")

</div>

Hi,  
I’m trying to use Hail to run a logistic regression GWAS on a case-control(0 vs 1) phenotype. I have two questions:

1. What input phenotype is expected by Hail? 0 vs 1 in tfloat64 format or True vs False in tbool format?
2. If I would like to run Hail in .py scripts on remote school linux servers, are there any mistakes I made in my code?

> #!/s/bin/python3  
> import hail as hl  
> hl.init()
> 
> mt = hl.import\_plink(bed=‘chr22.bed’,bim=‘chr22.bim’,fam=‘chr22.fam’,quant\_pheno=False)  
> covar = (hl.import\_table(‘pheno\_covariate.txt’,types={‘IID’:hl.tstr,‘mypheno’:hl.tbool},impute=True).key\_by(‘IID’))
> 
> mt = mt.annotate\_cols(covar=covar[mt.s])
> 
> mt\_logistic =hl.logistic\_regression\_rows(test=‘wald’,y=[mt.covar.mypheno,mt.covar.mypheno],x=mt.GT.n\_alt\_alleles(),  
> covariates=[1,mt.covar.IsMale,mt.covar.Year,mt.covar.IsAxiom,mt.covar.PC1,mt.covar.PC2,  
> mt.covar.PC3,mt.covar.PC4,mt.covar.PC5,mt.covar.PC6,mt.covar.PC7,  
> mt.covar.PC8,mt.covar.PC9,mt.covar.PC10])
> 
> mt\_logistic.export(‘chr22\_hail.txt’)

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [October 14, 2020, 12:07pm UTC](https://discuss.hail.is/t/logistic-regression-on-remote-servers/1735/2 "2020-10-14T12:07:46Z")

</div>

> [@Stephen](#):
>
> - What input phenotype is expected by Hail? 0 vs 1 in tfloat64 format or True vs False in tbool format?

Either one is fine. The method technically expects float64s, but booleans are coercible to floats as 0.0 / 1.0.

> [@Stephen](#):
>
> 1. If I would like to run Hail in .py scripts on remote school linux servers, are there any mistakes I made in my code?

This looks right to me!
