The data in a text looks like this:
Initial Speed
Pedal Rotation 10 mph 25 mph 40 mph 55 mph
5 degrees 0.35 0.19 0.14 0.10
8 degrees 0.37 0.28 0.19 0.19
10 degrees 0.42 0.30 0.29 0.23
The numbers in the table represent acceleration.
I would like to know how to get this information ready to run a manova test in R.
I have created variables from the columns and rows:
mph10 <- c(0.35, 0.37, 0.42)
mph25 <- c(0.19, 0.28, 0.30)
mph40 <- c(0.14, 0.19, 0.29)
mph55 <- c(0.10, 0.19, 0.23)
and
d5 <- c(0.35, 0.19, 0.14, 0.10)
d8 <- c(0.37, 0.28, 0.19, 0.23)
d10 <- c(0.42, 0.30, 0.29, 0.23)
I have found some tutorials on Youtube that show how to do manova, they all use .csv files and jump right into using manova without explaining how the data is arranged in the files or how to make your own.
So, I have no idea what to do next....
You should convert your data to a data frame prior to analysis, your code above only creates unlinked columns. Suggested code (probably more efficient way to do it, this works):
degrees <- data.frame(Degrees = c("d5","d8","d10"), MPH10=c(0.35, 0.37, 0.32),
MPH25=c(0.19, 0.28, 0.30), MPH40=c(0.14, 0.19, 0.29), MPH55=c(0.10, 0.19, 0.23))
Test of data:
degrees
Degrees MPH10 MPH25 MPH40 MPH55
1 d5 0.35 0.19 0.14 0.10
2 d8 0.37 0.28 0.19 0.19
3 d10 0.32 0.30 0.29 0.23
You should now be able to analyse degrees in manova.
When you did your c(...)
for your MPH variables, you set these up as observations, not variables. If you want to input columns rather than rows, the rbind()
command is used.
So the command mph10 <- c(0.35, 0.37, 0.42)
will give the following output to mph10
:
[1] 0.35 0.37 0.42
whereas mph10 <- rbind(0.35, 0.37, 0.42)
gives
[,1]
[1,] 0.35
[2,] 0.37
[3,] 0.42
HTH.