2011-09-16 46 views
2
更改「參數表」的背景

請考慮:在數學

listA = {5, 10, 6, 9, 10, 9, 8, 0, 4, 2}; 
listB = {2, 8, 7, 1, 7, 6, 10, 5, 1, 5}; 

Column[Function[listNo, 
       LinearModelFit[listNo, x, x]["ParameterTable"]] /@ 
       {listA, listB}] 

enter image description here

Customize ANOVA Table in Mathematica繼前一個問題,我想知道我怎樣才能改變上述背景。我希望每個人都有不同的背景顏色。

使用Belisarius技巧我能夠做到以下,但是,現在他們是有色的,我意識到那些表是不一樣的大小。請讓我知道是否有解決顯示問題的方法。

Blockquote

+0

是的,我的確和糾正爲好。我很疑惑你的評論是在4分鐘前,我在17分鐘前編輯了這個錯誤!? – 500

回答

3

你可以做類似

Column[Style[#[[1]], Background -> #[[2]]] 
    & /@ ({LinearModelFit[#[[1]], x, x]["ParameterTable"], #[[2]]} 
      & /@ {{listA, Yellow}, {listB, Red}})] 

enter image description here

編輯

你必須要工作了這一點A L如果你想要一個直接的結局,那就更多。喜歡的東西:

listA = {5, 10, 6, 9, 10, 9, 8, 0, 4, 2}; 
listB = {2, 8, 7, 1, 7, 6, 10, 5, 1, 5}; 
tit = {"", "Estimate", "Standard Error", "t\[Hyphen]Statistic", 
    "P\[Hyphen]Value"}; 


Grid[Flatten[ 
    Join[{{tit}}, (Join[{#[[1]]}, #[[2]]] & /@ 
     Partition[(Riffle[#["BasisFunctions"], #["ParameterTableEntries"]] &@ 
        LinearModelFit[#, x, x]), 2] & /@ {listA, listB})], 1], 
Background -> {{White, {None}}, {None, {Pink, Pink, Yellow, Yellow}}}, 
Dividers -> {2 -> True, 2 -> True}, 
Frame -> {{True}, {True}}, 
FrameStyle -> Directive[Thickness[2], Blue]] 

enter image description here

+0

非常感謝你belisarius! – 500

+0

我需要你的幫助:-)。請看看我的編輯。我怎樣才能讓它變得更直接更好:-)? – 500

+0

嘿對不起,出了點問題。請立即看到編輯。讓我知道如果我能弄清楚這些問題。 – 500