Re: [R] Extracting only some coefficients for the logistic regression model and its plot

2022-06-15 Thread anteneh asmare
Dear Rui, Thanks it works! Best, Hana On 6/15/22, Rui Barradas wrote: > Hello, > > With ggplot it's easy, add color = id and coord_flip(). > > > ggplot(ORCI, aes(id, OR, color = id)) + >geom_point() + >geom_errorbar(aes(ymin = `2.5 %`, max = `97.5 %`)) + >coord_flip() + >theme_bw()

Re: [R] Extracting only some coefficients for the logistic regression model and its plot

2022-06-15 Thread anteneh asmare
Dear Rui, thanks a lot, dose it possible to have the horizontal line for scale OR value on Y axis and different color for entire box plots ? Best, Hana On 6/15/22, Rui Barradas wrote: > Hello, > > To extract all but the first 2 rows, use a negative index on the rows. > I will also coerce to data

Re: [R] Extracting only some coefficients for the logistic regression model and its plot

2022-06-14 Thread Rui Barradas
Hello, To extract all but the first 2 rows, use a negative index on the rows. I will also coerce to data.frame and add a id column, it will be needed to plot the confidence intervals. ORCI <- exp(cbind(OR = coef(model ), confint(model )))[-(1:2), ] ORCI <- cbind.data.frame(ORCI, id = row.name

[R] Extracting only some coefficients for the logistic regression model and its plot

2022-06-14 Thread anteneh asmare
sample_data = read.table("http://freakonometrics.free.fr/db.txt",header=TRUE,sep=";";) head(sample_data) model = glm(Y~0+X1+X2+X3,family=binomial,data=sample_data) summary(model) exp(coef(model )) exp(cbind(OR = coef(model ), confint(model ))) I have the aove sample data on logistic regression wit