slope = r.round(float(raw_slope), digits=10)[0] except Exception: slope = "NA" print("Slope (c%d)\t%s" % (x_cols[ind - 1] + 1, slope), file=fout) try: # pval = r.round(float(co[ind][3]), digits=10) pval = r.round(float(co.rx2(ind + 1, 4)[0]), digits=10)[0] except Exception: pval = "NA" print("p-value (c%d)\t%s" % (x_cols[ind - 1] + 1, pval), file=fout) ind += 1 # rsq = summary.get('r.squared','NA') rsq = summary.rx2("r.squared") if rsq == ri.RNULLType(): rsq = "NA" else: rsq = rsq[0] try: # rsq= r.round(float((null_deviance-residual_deviance)/null_deviance), digits=5) rsq = r.round(float((null_deviance - residual_deviance) / null_deviance), digits=5)[ 0 ] # null_deviance= r.round(float(null_deviance), digits=5) null_deviance = r.round(float(null_deviance), digits=5)[0] # residual_deviance= r.round(float(residual_deviance), digits=5) residual_deviance = r.round(float(residual_deviance), digits=5)[0]
def testRNULLType_nonzero(self): NULL = rinterface.RNULLType() self.assertFalse(NULL)