[R] How to do ANOVA with fractional values and overcome the
(Ted Harding)
Ted.Harding at manchester.ac.uk
Thu Sep 6 10:39:07 CEST 2007
On 06-Sep-07 06:55:36, Emre Sevinc wrote:
> I have exported a CSV file from my EXCEL worksheet and its last column
> contained decimal values:
>
> Subject;Group;Side;Difference;PercentError
> M3;1;1;;
> M5;1;1;375;18,75
> M8;1;1;250;14,58
> M10;1;1;500;12,50
> M12;1;1;375;25,00
> .
> .
> .
>
>
> When I tried to do ANOVA test on it, R complained by givin error:
>
>> Anova3LongAuditoryFemaleError.data <- read.csv("C:\\Documents\ and\
>> Settings\\Administrator\\My
>> Documents\\CogSci\\tez\\Anova3LongAuditoryFemaleError.csv", header =
>> TRUE, sep = ";")
Perhaps you need to specify the "dec" option to read.csv():
read.csv(file, header = TRUE, sep = ",", quote="\"", dec=".",
fill = TRUE, ...)
i.e.
Anova3LongAuditoryFemaleError.data <- read.csv("C:\\Documents\ and\
Settings\\Administrator\\My
Documents\\CogSci\\tez\\Anova3LongAuditoryFemaleError.csv",
header = TRUE, sep = ";", dec=",")
Or else use read.csv2(), where dec = "," is the default. See
?read.csv
and read about both read.csv and read.csv2
Otherwise, "18,75" is likely to be treated as text, and not as
a numerical value, and so PercetError will be converted into
a factor with character-valued levels.
Ted.
>
>> Anova3LongAuditoryFemaleError.aov = aov(PercentError ~ (Group * Side),
>> data = Anova3LongAuditoryFemaleError.data)
>
> Error in `storage.mode<-`(`*tmp*`, value = "double") :
> invalid to change the storage mode of a factor
> In addition: Warning message:
> using type="numeric" with a factor response will be ignored in:
> model.response(mf, "numeric")
>
> What must I do in order to make the ANOVA test on these fractional
> data?
>
> Regards.
>
> --
> Emre Sevinc
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 06-Sep-07 Time: 09:39:04
------------------------------ XFMail ------------------------------
More information about the R-help
mailing list