My excel sheet has Time(s) as a heading.
when I input it into one of my codes in python for two-way anova analysis like so:
F1_para1 = 'ROI'
F2_para2 = 'Drug'
value = 'Time(s)'
df['comb'] = df[F1_para1].map(str) + "+" + df[F2_para2].map(str) #group for pairwise comparison
mod = ols(value+'~'+F1_para1+'+'+F2_para2+'+'+F1_para1+'*'+F2_para2, data = df).fit()
aov = anova_lm(mod, type=2)
I get this error message
PatsyError: Error evaluating factor: NameError: name 'Time' is not defined
Time(s)~ROI+Drug+ROI*Drug
^^^^^^^
Was thinking it has something to do with (s) as it works fine with dataframe headings without brackets. Is there a way around this?
Current Troubleshooting attempts
PatsyError: Error evaluating factor: NameError: name 'Time' is not defined Time((s))~ROI+Drug+ROI*Drug ^^^^^^^^^
Leaving this here in case someone needs help
Use Q("Time(s)")
to overcome the issue