What follows is a reduced version of what I'm trying to do.
The following object should be returned by a statistical inference
procedure:
inference_result("Mean Test",
[ ["Mean estimate",998],
["Method","Exact t-test. Unknown variance."],
["Confidence level", 0.95],
["Confidence interval", [991, 1004]],
["Hypotheses", "H0: mu = 1000 / H1: mu # 1000"],
["Statistic", .9035],
["Distribution", "Student's t(4)"],
["p-value", 0.4173] ]);
which is constructed by
(defun $inference_result (title values)
(list '(inference_result simp) title values))
Now, what I want is to get the above object to be displayed by default
in a more readable fashion, something like the following format could be
ok (I'm open to other solutions),
[ Mean Test ]
[ ]
[ Method -> Exact t-test. Unknown variance. ]
[ ]
[ Confidence interval -> [991, 1004] ]
[ ]
[ Confidence level -> 0.95 ]
See that only the 2nd, 4th and 3rd values are displayed, while the rest
are hidden. I want to hide part of the results because they are not
needed in some contexts, but could be accessed if necessary.
Inspared by a thread in this list of some years ago between Stavros and
Martin Rubey about the graph package, I wrote the following:
(displa-def $inference_result dimension-inference)
(defun dimension-inference (form result)
(let ( (title (cadr form))
(output1 (rest (nth 2 (caddr form))))
(output2 (rest (nth 4 (caddr form))))
(output3 (rest (nth 3 (caddr form)))))
(dimension-function
`(($matrix simp)
((mlist simp) title)
((marrow simp) ,(car output1) ,(cadr output1))
((marrow simp) ,(car output2) ,(cadr output2))
((marrow simp) ,(car output3) ,(cadr output3)) )
result) ))
But unfortunately, these two pieces of code don't work; when I call
inference_result, the complete inference_result object is displayed
without the desired output format. For sure, I'm missing something about
setting up the display property.
Best wishes
--
Mario Rodriguez Riotorto
www.biomates.net