I am trying to implement the code from this link:
http://rcompanion.org/handbook/H_09.html
specifically the code for this example: "Example of extended Cochran–Armitage test 1"
The problem is I am trying to read in a csv file containing the data for the "Input" table. The csv table is the same as the table in the sample code, i.e.
I then proceed to write the following code myself in R;
> library(readr)
> rtestdata <- read_csv("C:/Users/Rayyan/Desktop/rtestdata.csv")
> View(rtestdata)
> a<-ftable(rtestdata)
>
> sum (a)
[1] 3
> prop.table(a,
+ margin = 1) ### proportion in each row
the resulting prop.table looks nothing like the one on the website, here is what it looks like:
Can you please help me with this? Thanks