Finding p for trend in R - testing the trend across an ordinal categorical variable How do I calculate $p$ for a trend in R? My predictor variable is an ordered categorical variable with 4 categories and my outcome is dichotomous. (I am also using survey data so I want to use the weights, and survey design).
Model:
mod <- svyglm(outcome ~ predictor + cov1 + cov2, design = svydsgn, family = quasipoisson())

For the result, I am getting answers for each category of the predictor such as:
Cat B: 2.35 (1.5 - 3.5), P<0.001
Cat C: 3.50 (2.7 - 4.5), p<0.00002 etc. (Category A is the reference category). 

How do I test the trend across the three categories of my predictor? My predictor variable is already defined.

You have to transform your factor predictor to an ordered factor by, e.g.
mydata$ord_predictor <- ordered(mydata$predictor)

Then in the output of your model, you should see, among other things, coefficients named: ord_predictor.L, ord_predictor.Q, ord_predictor.C along with the associated estimates and p-values.
Here, ord_predictor.L refers to the linear trend. If it has a significant estimate, it means there is a linear trend in the estimated relation.  By the same token, ord_predictor.Q tells you if there is a quadratic trend, ord_predictor.C relates to the cubic trend ad so on.
