#!/bin/sh

# Data columns:
# 1. Subject number
# 2. pos
# 3. SOA
# 4. IDD
# 5.  prev targ hit/miss 
# 6. ACCuracy

echo > resultscond.txt
 echo -e "\f Raw accuracy\n" >> resultscond.txt
 cat "conddataout.txt" | tr "\r" "\n" | \
 awk -F "\t" '$1>0 && $3>0  {print $1, $3,$4, $5, $6}' \
 | anova sub SOA IDD hitmiss t1corr >> resultscond.txt


 echo -e "\f Raw accuracy SOA 100ms \n" >> resultscond.txt
 cat "conddataout.txt" | tr "\r" "\n" | \
 awk -F "\t" '$1>0 && $3>0 &&$3 <2 {print $1,$4, $5, $6}' \
 | anova sub IDD hitmiss t1corr >> resultscond.txt

 echo -e "\f Raw accuracy SOA 100ms with Pos\n" >> resultscond.txt
 cat "conddataout.txt" | tr "\r" "\n" | \
 awk -F "\t" '$1>0 && $3>0 &&$3 <2 && $1!=4{print $1,$2,$4, $5, $6}' \
 | anova sub pos IDD hitmiss t1corr >> resultscond.txt

