CRSU-Apps / MetaInsight

An interactive web-based tool for analyzing, interrogating, and visualizing network meta-analyses using R-shiny
https://crsu.shinyapps.io/MetaInsight/
GNU General Public License v3.0
9 stars 9 forks source link

MR 25 Contribution matrix and unit tests. #116

Closed tommorris168 closed 8 months ago

tommorris168 commented 10 months ago

Everything is ready except for testing the contribution matrix itself. I have one example where we know what the output is supposed to be, and another bigger one where I might have to type in the data myself because it's in a PDF. The two examples only cover one case out of six, so for the other five we might only be able to check that the matrix is not too different than in the first case. Based on my testing so far, fixed or random effects can change the matrix a fair bit but shared/exchangeable/unrelated doesn't seem to.

BalancedmonkeY commented 8 months ago

I've asked Janion for a review to see if there are any improvements that can be made regarding matrix/vector calculations/wrangling :)

tommorris168 commented 8 months ago

When I ran the unit test, 3 of them failed: CreateContributionMatrix() produces a matrix of the correct format for all three covariate parameter assumptions CreateContributionMatrix() produces a matrix of the correct format when study_or_comparison_level = 'study' CreateContributionMatrix() produces a matrix of the correct format when basic_or_all_parameters = 'basic'

The error was the same for all of them: Error in$<-.data.frame `(tmp, Treatment, value = character(0)): replacement has 0 rows, data has 9`

It looks like this was caused by the csv file being delimited with ; rather than , as per Janion's comment. Fixed.