Plain vanilla R does not have a built in function for computing confidence intervals for relative risk. But we can make our own relative risk function.
RRvariance = function(s1,s2,n1,n2) {
# Returns the variance of the natural log of the relative risk.
# s1 and s2 are the numbers of successess in groups 1 and 2, respectively. n1 and n2 are the totals for the two groups.
1/s1-1/n1+1/s2-1/n2
}
var = RRvariance(1392,1748,5348,8471)
var
Then to compute the 95% confidence interval, we use the formula $RRe^{\pm z^* \sigma }$. Remember that the standard deviation $\sigma$ is the square root of the variance.
RR = (1392/5348)/(1748/8471)
RR*exp(-1.96*sqrt(var))
RR*exp(1.96*sqrt(var))