For my master thesis I want to create a table in Rstudio, however I cannot find the right way to do it. I hope you can help me or push me in the right direction.
I want to find out whether organisations differ in their budget residual (ratio variable, percentage above or below budget) if they have a certain type of instrument in place. So I want to create a table with the mean (sd) of that budget residual for different organization sizes (small, medium, large) if they have an instrument (1, 2, 3) in place. The instrument is a dummy variable with variable 1 of having that instrument and 0 for not having that instrument. Also, I would like to have the p-value of whether the differences between the two means of having or not having that instrument for a small organisation in the table (for example with a Kruskal wallis test). I also work with latex, so I want to export it in latex format.
I already tried compareGroups package but that gives the mean of the instruments itself and not of the budget.