Displaying 2 results from an estimated 2 matches for "sex01".
Did you mean:
ex01
2008 Jul 17
2
nested calls, variable scope
...global, which of course is dangerous. What is the elegant or appropriate way to solve this?
# The call to ns works at the command line:
> junk<-ns(DAT$Age, knots=74)
# The call to lmer works at the command line, with the call to ns nested within it:
> junk2<-lmer(formula=Finished ~ Sex01 + ns(DAT$Age, knots= 74 ) + MinCC + PzC + (1 | NAME ) + (1 | Year), data=myDATonly, family="binomial")
But now I want to do this within a function such as the following:
> myfn
function(myknot=74) {
library(lme4)
library(splines)
cat("myknot=", my...
2008 Jul 31
2
dput vs unclass to see what a factor really is composed of
I used read.dta() to read in a Stata 9 dataset to R. The "Sex01" variable
takes on two values in Stata: 0 and 1, and it is labeled "M" and "F"
respectively, analogous to an R factor. Thus, read.dta reads it in as a
factor.
Now, I wanted to see what this variable *really* is, in R. For instance,
sometimes R converts a 0/1 variable into...