Displaying 3 results from an estimated 3 matches for "reoffend".
Did you mean:
offend
2007 Dec 29
1
another index question
...ue of 'N' if values on certain
variables are >= 1 on other variables and assign a 'O' if values on
any variable which have a value <= 0.
The outcome of this code is to assign a single 'O'. Clearly I have
made a mistake somewhere.
pre_ <- new <- rep(0, nrow(reoffend))
> pre_ <- new[reoffend$pre01111 | reoffend$pre012 |
reoffend$pre013>= 1] <-'V'
> pre_ <- new[reoffend$pre02111>=1 | reoffend$pre02114>=1 |
reoffend$pre2029>=1 | reoffend$pre0212>=1 | reoffend$pre0211>=1]<- 'V'
> pre_ <- new[reoffen...
2007 Dec 28
1
index question
...is a value
of 1 or greater for pre2029 assign a value of 4; everything else = 0.
If a case has multiple values, 02111 prevails over 2114, 2114
prevails over 0211, 0211 prevails over 0212; 0212 prevails over 2029.
I believe I can generate new variables (1) - (5) using code such
as: ASS <- (reoffend$pre02 | reoffend$pre02111 | reoffend$pre02114 |
reoffend$pre0211 | reoffend$pre0212 | reoffend$pre029 >= '1')
I have three questions:
1. If this is correct, what is the most efficient way to generate (1)
without having to type all the variable names. The following does not
work: PR...
2006 Oct 22
2
"glm" function question
I am creating a model attempting to predict the probability someone will
reoffend after being caught for a crime. There are seven total inputs and I
planned on using a logistic regression. I started with a null deviance of
182.91 and ended up with a residual deviance of 83.40 after accounting for
different interactions and such. However, I realized after that my code is
diffe...