Skip to content

Commit 8a984f5

Browse files
committed
change some outputs to data.frame
makes comparible with anova outputs
1 parent 034ad9a commit 8a984f5

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

R/kw_rank_sum_class.R

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ kw_rank_sum<-setClass(
4848
description='The method used to adjust for multiple comparisons.'
4949
),
5050
outputs.test_statistic=entity(name='test statistic',
51-
type='numeric',
51+
type='data.frame',
5252
description='the value of the calculated statistic which is converted to a p-value when compared to a chi2-distribution.'
5353
),
5454
outputs.p_value=entity.stato(name='p value',
5555
stato.id='STATO:0000175',
56-
type='numeric',
56+
type='data.frame',
5757
description='the probability of observing the calculated t-statistic.'
5858
),
5959
outputs.dof=entity.stato(name='degrees of freedom',
@@ -63,7 +63,7 @@ kw_rank_sum<-setClass(
6363
),
6464
outputs.significant=entity(name='Significant features',
6565
#stato.id='STATO:0000069',
66-
type='logical',
66+
type='data.frame',
6767
description='TRUE if the calculated p-value is less than the supplied threhold (alpha)'
6868
)
6969
)
@@ -91,11 +91,19 @@ setMethod(f="model.apply",
9191
output=merge(temp,as.data.frame(t(output),stringsAsFactors = FALSE),by=0,all=TRUE,sort=FALSE)
9292
rownames(output)=output$Row.names
9393
output=output[,-1]
94+
9495
output$p.value=p.adjust(output$p.value,method = param.value(M,'mtc'))
95-
output.value(M,'test_statistic')=output$statistic
96-
output.value(M,'p_value')=output$p.value
96+
97+
output.value(M,'test_statistic')=data.frame(output$statistic)
98+
colnames(M$test_statistic)=M$factor_names
99+
100+
output.value(M,'p_value')=data.frame(output$p.value)
101+
colnames(M$p_value)=M$factor_names
102+
97103
output.value(M,'dof')=output$parameter
98-
output.value(M,'significant')=output$p.value<param.value(M,'alpha')
104+
105+
output.value(M,'significant')=data.frame(output$p.value<param.value(M,'alpha'))
106+
colnames(M$significant)=M$factor_names
99107

100108
return(M)
101109
}

0 commit comments

Comments
 (0)