I'm trying to run a Mann-Kendall test using a data set I have..I'm struggling with code as I keep getting an error (Input vector must contain at least three values).
What I'm trying to do is to run a Mann-Kendall test for these two variables - Year, Age groups - I'm charting the incidence of colo-rectal cancer per 100,000 population for each individual age group.
I have so far run the following commands on R after uploading my dataset
library(modifiedmk)
mkttest(I 35-39)
I 35-39 is the column, incidence in the 35 to 39 year olds. Could the error lie in the fact that the data hasnt originally been rounded up uniformly on the excel sheet. for e.g. I have 5.0292 (incidence for year 1993) in one box and 5.23 (incidence for year 2004) in the other
I created a 'vector' and then entered the mkttest(I30)..I'm finding it hard to conceptualise the need for a vector?
I30-<colorectal_incidence_hidden$nI 30-34 --- where colorectal_incidence_hidden was the file name and nI 30-34 was the column that had the incidence of colorectal cancer for this age group (30-34 years) over the years.
Why do I have to create vector for each of these variables and THEN run the test?? Why can't I just run it directly?
Sorry if this is a daft question. I've only started using R this week. Thanks.
The only issue is that it looks like your variable/column names has spaces which R does not like. Therefore you need the I 35-39 format so that R recognizes that as a column name.
If I am not making sense can you supply some sample data? A handy way to supply sample data is to use the dput() function. See ?dput. If you have a very large data set then something like head(dput(myfile), 100) will likely supply enough data for us to work with.