2x2 table Independence test

Hi everyone i would like to make a matrix in rstan and run an independence test based some priors like beta or dirichlet.Any ideas?I am totally new on this and confused.
fish="
data {
matrix[2,2] x;
}
parameters {
vector<lower=0,upper=1> theta[1];
vector<lower=0,upper=1> theta[2];
}
model {
y ~ binomial(N, theta);
}
generated quantities {
real p1 - p2 = theta[1] - theta[2];
int p1_p2 = theta[1] > theta[2];
}"
depsmok <- matrix(c(144,1729,50,1290),byrow=TRUE,ncol=2);
dimnames(depsmok) <- list(Ever_Smoker=c(“Yes”,“No”),
Depression=c(“Yes”,“No”))
depsmok
data_list <- list(x = depsmok)
data_list
stan_samples <- stan(model_code = fish,thin=5,data = data_list)

I fear you need to make your question more specific to be answerable: what does your data represent? What are your scientific questions? In general the approach to Bayesian statistics as practiced by most of the community does not do “tests”, as this is not straightforward to do with Stan. Instead people are usually interested in estimates of some quantity - e.g. estimate the difference between two success probabilities (if you absolutely need to do tests, frequentist approaches are likely a better bet).

P.S. Note that you can use backticks (`) and triple backticks for inline code and code blocks respectively to make your posts easier to read :-)