I am writing a thesis that will require the reporting of the results of multiple ANOVAs. Reporting these follows the format F1,16=5.06, P=.009. I would like a tool that does this formatting for me, potentially allowing me to switch between formats for the whole text easily, for example allowing me to change it to F(1,16)=5.06, P=.009, or even F(1,16)=5.06, P<.01 if we're getting fancy. EDIT: For the P<.01 option, an ideal solution would be that the user can add ~3 levels of significance, say, P<.05, P<.01 and P<.001 and the function automatically assigns one of these, based on the reported value.
I guess this would take the format of a custom function that would allow this to work: \reportANOVA{1,16,5.06,.009}
with a function that looks something like this
reportANOVA <- function{DFN,DFD,F,P}{
return(F\textsubscript{DFN,DFD}=F, \textit{p}=P)
}
The results of the function need to be within the text.
Is such a thing possible in LaTeX? I have only been using it for a week or so, so I don't know a great deal about it, but obviously similar things are possible in other programming languages (I used R's syntax here).
Since I was asked to add a MW*E, here's one:
\documentclass{article}
\usepackage{fixltx2e}
%Function in the preamble like this
reportANOVA <- function{DFN,DFD,F,P}{
return(F\textsubscript{DFN,DFD}=F, \textit{p}=P)
}
\begin{document}
Stats are \reportANOVA{1,16,5.06,.009}
\end{document}
*Obviously this doesn't work.
<
case, rounding is involved. What are the rules for this? For example, what if the original value is.0009
or.04
? It can't just be to 2 decimal places else=.04
will become<.04
. So what can we assume here and what's the target behaviour?