search for: subnum

Displaying 4 results from an estimated 4 matches for "subnum".

2003 Oct 17
1
as.matrix does not turn data frame into character matrix
...column into a character vector using `format' and so return a character matrix." But this does not appear to be the case in the following example. Instead, as.matrix turns a data.frame into a list, not a character matrix, which wreaks havoc with my old code. junk<- structure(list(SUBNUM = structure(c(3, 4, 5, 7, 6), class = "factor", .Label = c("01", "02", "03", "04", "07", "08", "09", "10", "11", "12", "13", "16", "17", "18", "...
2008 Oct 03
1
question on xyplot
...ultilevel) data(univbct) #a data set already in univariate or stacked form for job satisfaction TEMP<-univbct[3*1:495,c(22,1:17)] #converting it back to multivariate form TEMP2<-make.univ(x=TEMP,dvs=TEMP[,c(10,13,16)]) #transforming it to univariate form again xyplot(MULTDV~TIME|as.factor(SUBNUM),data=TEMP2,type=c("p","r","g"),col="blue",col.line="black",xlab="Time",ylab="SAT") # taken from Bliese Paul ? Multilevel Modeling in R Now I want to be able to identify those SUBNUM that have a downwards trend like (for eg SUBN...
2009 Oct 23
1
making a plot in xyplot
Hello, I am a newbie to the lattice package in R, and I'm trying to make a plot using the xyplot function. I have repeated measures data (2 conditions) for two different groups of subjects (teens and adults). So far, I've made a basic graph using xyplot(y ~x, group=subnum, data=mydata, type="b"). Now I would like to make all the teens' lines one color and the adults' another. Additionally, I'd like to reformat the dots so that the points referencing condition 1 and condition 2 are different. Can you help me with this? Thanks! Sarah Sarah O...
2003 Feb 28
2
lattice and fitted function error
Platform: WIN2000 Version of R: 1.6.2 I'm interested in plotting fitted values in a trellis xyplot. I believe the following should work; however, I only get the points (not the fitted lines). library(lattice) trellis.device(bg="white") xyplot(MULTDV~TIME|SUBNUM,data=TEMP, panel=function(x,y){ panel.xyplot(x,y) lines(x,fitted(lm(y~poly(x,1),na.action=na.omit))) lines(x,fitted(lm(y~poly(x,2),na.action=na.omit)),lty=3)}, xlab="Time", ylab="Average Reaction Time") Happy to send the very small TEMP file for the curious... Any sugges...