Skip to content

Commit

Permalink
minor tidy output
Browse files Browse the repository at this point in the history
  • Loading branch information
EvoArt committed Feb 2, 2022
1 parent 32ff6a6 commit fc71f6b
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/output.jl
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
function get_output(coefs,Df,sq,r2,f_terms,Gres,Tot,p,n)
n_term = length(coefs)
DF = RegCol("Df")
R2 = RegCol("")
sumsq = RegCol("SumOfSqs")
F = RegCol("F")
P = RegCol("P")
n_term = length(coefs)
DF = RegCol("Df")
R2 = RegCol("")
sumsq = RegCol("SumOfSqs")
F = RegCol("F")
P = RegCol("P")


for i in 1:n_term
setcoef!(R2, coefs[i]=>r2[i])
setcoef!(DF, coefs[i]=>Df[i])
setcoef!(sumsq, coefs[i]=>sq[i])
setcoef!(F, coefs[i]=>f_terms[i])
setcoef!(P, coefs[i]=>p[i])
end
coefArray = hcat(Df,sq,r2,f_terms,p)
coefArray= vcat(coefArray,[n-1-sum(Df) Gres 1-sum(r2) NaN NaN ])
coefArray= vcat(coefArray,[n-1 Tot 1 NaN NaN ])
for i in 1:n_term
setcoef!(R2, coefs[i]=>r2[i])
setcoef!(DF, coefs[i]=>Df[i])
setcoef!(sumsq, coefs[i]=>sq[i])
setcoef!(F, coefs[i]=>f_terms[i])
setcoef!(P, coefs[i]=>p[i])
end
coefArray = hcat(Df,sq,r2,f_terms,p)
coefArray= vcat(coefArray,[n-1-sum(Df) Gres 1-sum(r2) NaN NaN ])
coefArray= vcat(coefArray,[n-1 Tot 1 NaN NaN ])


setcoef!(R2, "Residual"=>1-sum(r2))
setcoef!(DF, "Residual"=>n-1-sum(Df))
setcoef!(sumsq, "Residual"=>Gres)
setcoef!(R2, "Total"=>1)
setcoef!(DF, "Total"=>n-1)
setcoef!(sumsq, "Total"=>Tot)
return NamedArray(coefArray,(vcat(coefs...,"Residual","Total"),["Df","SumOfSqs","R2","F","P"])), hcat(DF,sumsq,R2,F,P)
setcoef!(R2, "Residual"=>1-sum(r2))
setcoef!(DF, "Residual"=>n-1-sum(Df))
setcoef!(sumsq, "Residual"=>Gres)
setcoef!(R2, "Total"=>1)
setcoef!(DF, "Total"=>n-1)
setcoef!(sumsq, "Total"=>Tot)
return NamedArray(coefArray,(vcat(coefs...,"Residual","Total"),["Df","SumOfSqs","R2","F","P"])), hcat(DF,sumsq,R2,F,P)
end

0 comments on commit fc71f6b

Please sign in to comment.