1. ## trend line

Hello,

this is probably a very straight forward question to do with plotting:

I have boxplots representing turbidity from each of 5 rainfall catergories from a particular station. Each boxplot represents 4 years worth of data. (x axis = catergory; y-axis=total rainfall).

I was wondering if its possible to:

a) plot a median trend line (there is a clear positive trend)
b) can I also plot lines for percentiles (i.e 25th and 75th)?

Thanks in adance for any help.

2. Originally Posted by bugman
Hello,

this is probably a very straight forward question to do with plotting:

I have boxplots representing turbidity from each of 5 rainfall catergories from a particular station. Each boxplot represents 4 years worth of data. (x axis = catergory; y-axis=total rainfall).

I was wondering if its possible to:

a) plot a median trend line (there is a clear positive trend)
b) can I also plot lines for percentiles (i.e 25th and 75th)?

Thanks in adance for any help.
#for a) in R plot your boxplots and then type:
cat=1:5
lines(cat,tapply(y,x,median,na.rm=T))
#or use a fit model
abline(lm(tapply(y,x,median,na.rm=T)~cat))

#for B) see ?quantile, from the top of my head it should be something like this
percen=0.25
lines(cat,tapply(y,x,quantile, prob=percen))
percen=0.75
lines(cat,tapply(y,x,quantile, prob=percen))

3. many thanks!!!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts