<s>[INST] Sign table in $2^k$ factorial experiment I have a factorial experiment with four factors $\{A,B,C,D\}$ ($k=4$) , just to ilustrate the case with $k=3$, the signal table is 
\begin{matrix}
& I & A & B & C & AB & AC & BC & ABC\\
(1) & +1 & -1 & -1 & -1 & +1 & +1 & +1 & -1\\
a & +1 & +1 & -1 & -1 & -1 & -1 & +1 & +1\\
b & +1 & -1 & +1 & -1 & -1 & +1 & -1 & +1\\
ab & +1 & +1 & +1 & -1 & +1 & -1 & -1 & -1\\
c & +1 & -1 & -1 & +1 & +1 & -1 & -1 & +1\\
ac & +1 & +1 & -1 & +1 & -1 & +1 & -1 & -1\\
bc & +1 & -1 & +1 & +1 & -1 & -1 & +1 & -1\\
abc & +1 & +1 & +1 & +1 & +1 & +1 & +1 & +1\\
\end{matrix}
I know this is just a signal table with produtcts of $+ $and $-$, but is there any quick way to assemble it without having to look at the signs?
I would like to know it, because with the table is easier and faster to calculate the contrasts, otherwise I would have to do
$$A=(a-1)(b+1)(c+1)(d+1)$$
$$B=(a+1)(b-1)(c+1)(d+1)$$
$$.....$$
$$ABCD=(a-1)(b-1)(c-1)(d-1)$$
Is there any easier way to assemble this table?
As I need to make the table a hand to study for the exam, I was looking at it and I saw a few things about the contrasts
$(A,B,C,D)$: $+1$ in which the letter appears
$(AB,AC,BC,AD,BD,CD)$: $+1$ in $(1)$, in the rows where the pair appears and in the rows where one or two of the letters does not belong to the pair appears
$(ABC,ABD,ACD,BCD)$:$+1$ in rows which appears each letter of triple alone, row in which the triple appears and rows where the letter does not belong to triple appears (only in pairs)
$ABCD$: $+1$ in all pairs and $ABCD$
 [/INST] Let's start by isolating the basis:
$$\begin{array} {r|r|rrr|rrrr}
& I & A & B & C & AB & AC & BC & ABC\\
(1) & +1 & -1 & -1 & -1 & +1 & +1 & +1 & -1\\
a & +1 & +1 & -1 & -1 & -1 & -1 & +1 & +1\\
b & +1 & -1 & +1 & -1 & -1 & +1 & -1 & +1\\
ab & +1 & +1 & +1 & -1 & +1 & -1 & -1 & -1\\
c & +1 & -1 & -1 & +1 & +1 & -1 & -1 & +1\\
ac & +1 & +1 & -1 & +1 & -1 & +1 & -1 & -1\\
bc & +1 & -1 & +1 & +1 & -1 & -1 & +1 & -1\\
abc & +1 & +1 & +1 & +1 & +1 & +1 & +1 & +1\\
\end{array}$$
Columns $A,B,C$ are just counting in binary, but if you reordered the rows then they're still simple: $A$ is $+1$ iff $a$ is in the row label; etc.
Column $AB$ is just column $A$ pointwise multiplied by column $B$; similarly column $ABC$ is just column $AB$ pointwise multiplied by column $C$; so no cell in the table requires more than one multiplication.
The result is that it's a question of parity. For even-length column labels ($I$ counts as even because it's really a substitute for the empty string) you get $+1$ in rows where an even number of the letters occur (e.g. $ABCD$ is even, so it will be $+1$ in rows $(1)$, $ab$, $ac$, $ad$, $bc$, $bd$, $cd$, $abcd$); for odd-length column labels you get $+1$ in rows where an odd number of the letters occur (e.g. $ABC$ is odd, so it will be $+1$ in rows $a$, $b$, $c$, $ad$, $bd$, $cd$, $abc$, $abcd$).
Really there's no reason to prepare a table like this by hand. Whatever software you're using for the analysis can probably do it for you, but as an online option this program will generate a CSV file of the table. Just change the input value and press Run.
</s>