how to use aov commend in R Studio with only one column of data. the data name is temperature for example.
I know if there is two column of data i can use like avo(temperature~name, data=temperature), how to do it in one
aov is supposed to use in two columns. One should be response and other should be explanatory variable. However, if all the data belongs to one column only, there will be problems. Then you should know which ones are response and which ones are explanatory variables and you have to extract explanatory to another columns. But there will be some relief if the explanatory variable is only the grouping variable. Then you can make another array which should identify the grouping. For example, suppose you have,
>x=1:6
and the grouping is 1,2 and 6 belongs to group 1 and 3,4 and 5 belong to group 2.Then you should write the grouping variable as,
>group=as.fact(c(1,1,2,2,2,6))
The following code should work.
>aov(x~group)
Get Answers For Free
Most questions answered within 1 hours.