[R] Logistic Regression & Results per Condition

Eve Legrand evl.legrand at gmail.com
Fri Oct 3 15:32:02 CEST 2014


Hi everyone!
   I conducted a study for which I conducted logistic regressions (and it
works), but now I'd like to have the results per condition, and I failed to
discover how to have them. I explain myself:
   In conduted a study in which participants can realize one behavior
(coded "1" if realized) or another one (coded "0" if realized") (and errors
are coded "2"). This DV is called "Rep2". I also had one IV called
"TypeInt". This IV has two modalities: participants can be in the
"OnlyIntention" condition or in the "ImplementationIntention" condition. We
registered participants behaviors 64 times (we had 64 repeated measures),
this variable is called "NumEssai", and 40 participants participated (this
variable is called "Sujet").
   So I realized logistic regression for panel data (so with a cluster
correction) on this variables thanks to the lrm and robcov functions, and I
obtained results which are (normally) the good ones. So I obtained the
interactions between all these variables. Here is my script:

<b>library(rms)
PunSon <- read.csv2("C:/Users/Eve/Desktop/Stats/Stats.csv")

NumEssai <- PunSon$NumEssai
Rep2 <- PunSon$Rep2
TypeInt <- PunSon$TypeInt
Sujet <- PunSon$Sujet

f <- lrm(Rep2 ~ NumEssai * TypeInt, data = PunSon[PunSon$Rep2 != 2, ],
x=TRUE, y=TRUE)
g <- robcov(f, cluster=PunSon[PunSon$Rep2 != 2, ]$Sujet)
g</b>

  But now, I'd like to have the results per condition (for example, have
the results in the "onlyintention" condition). I tried some things like
using the "factor" function (I join the script I writed below), but it
doesn't work... Does someone knows how to have results per condition?

<b>library(rms)
PunSon <- read.csv2("C:/Users/Eve/Desktop/Stats/Stats.csv")

NumEssai <- PunSon$NumEssai
Rep2 <- PunSon$Rep2
TypeInt <- factor(PunSon$TypeInt)
Sujet <- PunSon$Sujet

f <- lrm(Rep2 ~ NumEssai * TypeInt, data = PunSon[PunSon$Rep2 != 2, ],
x=TRUE, y=TRUE)
g <- robcov(f, cluster=PunSon[PunSon$Rep2 != 2, ]$Sujet)
g</b>

Thanks by advance for any help!
Eve

	[[alternative HTML version deleted]]



More information about the R-help mailing list