search for: comb2

Displaying 5 results from an estimated 5 matches for "comb2".

Did you mean: combo
2012 Apr 05
1
integrate function - error -integration not occurring with last few rows
...ed$up[k]<-slope*exp(rnorm(1,0,rise_sd)) ed$bshz<-beta0 } comb1<-merge(data1[, c("ID","TIME")], ed) comb1$disprog<-1 comb1$beta1<-0.035 comb1$beta21<-0.02 comb1$beta22<-0.45 comb1$beta23<-0085 comb1$beta31<-0.7 comb1$beta32<-0.05 comb1$exphz<-1 comb2<-comb1 p<-0 for(l in 1:length(comb2$ID)) { p<-p+1 comb2$disprog[p]<-comb2$base[p]*exp(-comb2$drop[p]*comb2$TIME[p]) + comb2$up[p]*comb2$TIME[p] comb2$frac[p]<-ifelse ( comb2$DOSE[p]==3, comb2$beta31[p]*comb2$TIME[p]^comb2$beta32[p], exp(-comb2$b...
2012 Apr 08
1
Avoid loop with the integrate function
...data1[!duplicated(data1$ID) , c("ID","DOSE")] set.seed(5324123) for (k in 1:length(ed$ID)) { ed$base[k]<-100*exp(rnorm(1,0,0.05)) ed$drop[k]<-0.2*exp(rnorm(1,0,0.01)) ed$frac[k]<-0.5*exp(rnorm(1,0,0.1)) } comb1<-merge(data1[, c("ID","TIME")], ed) comb2<-comb1 comb2$score<-comb2$base*exp(-comb2$drop*comb2$TIME) func1<-function(t,cov1,beta1, change,other) { ifelse(t==0,cov1, cov1*exp(beta1*change+other)) } comb3<-comb2 comb3$cmhz=0 comb3<-comb3[order(comb3$ID, comb3$TIME), ] for (q in 1:length(comb3$ID)) { comb3$cmhz[q]<-integra...
2011 Sep 08
2
ggplot geom_freqpoly() layers ..?
...1),1000,10) colnames(tab) <- paste('b',1:ncol(tab),sep='') rownames(tab) <- 1:nrow(tab) tab2 <- melt(tab) ggplot(tab2) + geom_freqpoly(aes(x = value, y = ..density.., colour = X2)) ###### Combined plot comb <- cbind(mat,tab) comb2 <- melt(comb) cols <- c(rep('red',ncol(mat)*nrow(mat)),rep('black',ncol(tab)*nrow(tab))) ggplot(comb2) + geom_freqpoly(aes(x = value, y = ..density.., colour = cols)) ################### End code ############### Any help would be appreciated! t...
2011 Sep 08
1
ggplot2 freqpoly() layers..?
...  colnames(tab) <- paste('b',1:ncol(tab),sep='')     rownames(tab) <- 1:nrow(tab)     tab2 <- melt(tab)         ggplot(tab2) + geom_freqpoly(aes(x = value,                     y = ..density.., colour = X2))         ###### Combined plot     comb <- cbind(mat,tab)     comb2 <- melt(comb)     cols <- c(rep('red',ncol(mat)*nrow(mat)),rep('black',ncol(tab)*nrow(tab)))         ggplot(comb2) + geom_freqpoly(aes(x = value,                     y = ..density.., colour = cols)) ################### End code ############### Any help would be appreciate...
2012 Mar 25
2
avoiding for loops
I have data that looks like this: > df1 group id 1 red A 2 red B 3 red C 4 blue D 5 blue E 6 blue F I want a list of the groups containing vectors with the ids. I am avoiding subset(), as it is only recommended for interactive use. Here's what I have so far: df1 <- data.frame(group=c("red", "red", "red", "blue",