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}]

ここに画像の説明を入力

Mathematica での ANOVA テーブルのカスタマイズに関する以前の質問に続いて 、上記の背景を変更するにはどうすればよいか知りたいです。それぞれ背景色を変えたいです。

ベリサリウスのトリックを使用して、以下を実行できましたが、色が付けられたので、それらのテーブルが同じサイズではないことに気付きました。その表示の問題を回避する方法があれば教えてください。

引用符

4

1 に答える 1

3

次のようなことができます

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

ここに画像の説明を入力

編集

ストレートエンドが必要な場合は、これをもう少し解決する必要があります. 何かのようなもの:

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]]

ここに画像の説明を入力

于 2011-09-16T00:17:12.047 に答える