search for: xcol

Displaying 20 results from an estimated 21 matches for "xcol".

Did you mean: col
2009 Jul 31
2
another automation question
This code works: x<-letters[1:6] ycols<-23:28 xcols<-rep(c(3,4,5,8),each=length(ycols)) somertime<-function(i,j)somers2(Pred_pres_a_indpdt[,i,,], population[,j]) results<-mapply(somertime,xcols,ycols) How can I make variable "h" work? x<-letters[1:6] ycols<-23:28 xcols<-rep(c(3,4,5,8),each=length(ycols)) somertime&...
2010 Jan 07
1
LD50 and SE in GLMM (lmer)
...0.3, etc. to get the precise 0.500. Very clumsy but I guess it's correct? Now my biggest problem: how do I get the SE? John Maindonald goes on to do this: U <- chol(as.matrix(summary(model4)@vcov)) se <- sqrt(apply(X%*%t(U), 1, function(x)sum(x^2))) list(hat=hat, se=se, x=X[,xcol]) Unfortunately, I could not figure out what the chol(as.matrix...) part is about (chol does what?) and therefore I have no idea, how to use this code to get my LD50 SE (I would need the SE to be expressed in terms of x). Could anybody help me with this? And one more question: is it cor...
2011 Apr 14
4
Categorical bubble plot
Hi, I do not have much R experience just the basics, so please excuse any obvious questions. I would like to create bubble plot that have Categorical data on the x and y axis and then the diameter if the bubble the value related to x and y. Attached to the email is a pic of what I would like to do. I do hope someone can help me. -- Regards/Groete/Mit freundlichen Gr??en/recuerdos/meilleures
2005 Jul 06
2
Problem with dyn.load...or else...
...> tab<-c(1,1,3,4,6,6,3,5,7,67,5,6,65,3,5,1,5,42,3,567,6,4,7,7) > tab<-matrix(tab,6,4) And try to use the function: > K_MEANSR(tab,centers=c(2,4)) [1] "AA" [1] "AAA" [1] "A" [1] "B" Error in .C("K_MEANSC", xrows = as.integer(xrows), xcols = as.integer(xcols), : "C" function name not in load table Everything that is printed on the screen is correct, but why does it says that 'K_MEANSC' function is not in load table??? It then just stops at that stage of the .R function. Thank you all for your time, M...
2011 Oct 03
1
minimisation problem, two setups (nonlinear with equality constraints/linear programming with mixed constraints)
...ows: Minimise, over 100?1 real vectors v, and over scalars q >= 0, q such that, for i=1,...,100 v_i<=q v_i>=-q X'v=e_2 Here is my RGLPK code: ......................................................................... X <- # See end of this message for the X data XROWS <- 100 XCOLS <- 2 e_2=rep(0,times=XCOLS) e2[2]<- 1 obj <- c(rep(0,XROWS),1) # coefficients on v_1, . . . , v_100, q. mat <- matrix(rbind(cbind(diag(XROWS), rep(-1,XROWS)), cbind(diag(XROWS), rep(1,XROWS)), cbind(t(X), rep(0,XCOLS)), cbind(t(rep(0,XROWS)), 1)), nrow=2*XROWS+XCOLS+1) dir...
2005 May 26
1
PAN: Need Help for Multiple Imputation Package
...easurement occurred six times. Approximately 25% of participants dropped out at end. > sim <- read.xport('c:\\xptds.dat') > > int <- rep(1,1200) > y <- cbind(sim$MIY1,sim$TCOV1) > subj <- sim$ID > pred <- cbind(int, sim$TIME, sim$GROUP) > > xcol <- 1:3 > zcol <- 1 > prior <- list(a=2,Binv=4,c=2,Dinv=4) > result <- pan(y,subj,pred,xcol,zcol,prior,seed=13579,iter=1000) Error: subscript out of bounds By the way, I also received the same error message when I tried to include intercept and time in Zcol, a matrix for ran...
2005 Nov 03
0
problems with pan(): Indizierung ausserhalb der Grenzen = subscript out of bounds
...1 192 193 195 196 197 198 199 200 5 6 6 6 5 6 6 6 6 6 6 6 6 4 5 6 6 6 6 5 6 6 6 6 6 6 6 5 6 6 6 5 6 6 6 6 6 6 6 > pred <- cbind(interc=rep(1,dim(y)[1])) # just intercept (at first) > dim(pred) [1] 940 1 xcol <- 1:dim(pred)[2] > xcol [1] 1 #xcol = 1 , using all number of cols of pred[] > zcol <- c(1) # = 1 , number of cols to use > y.ncol <- dim(y)[2] > n.zcol <- length(zcol) > prior <- list(a=y.ncol, + Binv=diag(y.ncol), + c=n.zcol, +...
2007 Aug 27
2
validate (package Design): error message "subscript out of bounds"
...ll's c index, with optimism correction, for a multivariate Cox regression and also for some univariate Cox models. For some of these univariate models I have encountered an error message (and no result produced) from the function validate i Frank Harrell's Design package: Error in Xb(x[, xcol, drop = FALSE], coef, non.slopes, non.slopes.in.x, : subscript out of bounds The following is an artificial example wherein I have been able to reproduce this error message (actual data has been changed to preserve confidentiality): library(Design) # an example data frame: frame.bc &l...
2005 Aug 31
0
Imputation using Pan in R
.... It worked well. The next step for me is to imputate a model with one y variable and both random intercept and slope. The program ran well, but did not imputate any of my missing values. I attached my codes in the following. Did I do anything wrong in the codes? I am confused with the setting of xcol and zcol (and of course the "pred"). Do anyone know how to set these matrices when including both random intercept and slope or when having 2 or more y's? Any suggestions would be appreciated. Thanks! Yi-fu >library(pan) > y <- c(5,8,NA,10, + 2,NA,NA,NA, + 1...
2004 Feb 08
2
substitute, eval, quote and functions
Hi, i am working with large data frames with many dependend variables. I want to write some functions that will allow me to quickly select variables from the frame and plot them in various colors depending on factor columns, possibly selecting rows according to factor conditions. In order to do this in a nice function, i need to understand how to work with a column name in the body of a
2008 May 07
3
predict lmer
Hi, I am using lmer to analyze habitat selection in wolverines using the following model: (me.fit.of <- lmer(USED~1+STEP+ALT+ALT2+relM+relM:ALT+(1|ID)+(1|ID:TRKPT2),data=vdata, control=list(usePQL=TRUE),family=poisson,method="Laplace")) Here, the habitat selection is calaculated using a so-called discrete choice model where each used location has a certain number of alternatives
2015 Jul 10
0
colour palettes in biplot
biplot could benefit from allowing colour palettes, eg. allowing col=list(xcol= xxpal, ycol= yypal) where xxpal and yypal are palettes. For an example, see the robust pricipal components in the principal componetent section of <http://www.statlab.uni-heidelberg.de/data/olive/olive10.pdf> The required change is to replace col[1L] resp. col[2L] by col[1L]] reep. col[[...
2006 Oct 24
0
incorrect number of subscriptions error in user-written function
...can generate the combinations for each selection sec1 = combinations(4,2,1:4) sec2 = combinations(6,3,5:10) sec3 = combinations(8,5,11:18) I then wrote a function to combine the combinations for each selection. multiperm <-function(x, y) # function to combine combinations { xdim = nrow(x) xcol = ncol(x) ydim = nrow(y) ycol = ncol(y) v1 = matrix( nrow = xdim*ydim, ncol = xcol+ycol ) for ( i in 1:xdim) { for (j in 1:ydim){ v1[i + (j-1)*xdim , ] = c(x[i,], y[j, ])} } v1 = data.frame(v1) # set output as dataframe } This works fine when combining sec1 and sec2, comb =...
2007 Sep 24
0
longitudinal imputation with PAN
...ata$sex <-factor(impht.data$sex,label = c("Boys","Girls")) impht.data$visit <- factor (impht.data$visit) impht.data$code <- factor (impht.data$code) y <- impht.data$htmiss subj <- impht.data$code pred <- cbind (impht.data$age, impht.data$sex, impht.data$visit) xcol <- 1:3 zcol <- 1 prior <- list(a=1, Binv=1, c=1, Dinv=1) ht1 <- pan(y, subj, pred, xcol, zcol, prior, seed=13579, iter=1000) code sex visit age ht htmiss 1 2 1 4.87 105 105 1 2 2 5.86 109.6 1 2 3 6.88...
2011 Jun 21
0
R crash when using pan for multiple imputation
...#number the level 2 units from 1:n y<-as.matrix(DF[-1])                                               #specify the variables to be used for imputation                                                     pred <- matrix( rep( 1 , nrow(y) ) , ncol= 1)               #specify predictor matrix xcol <- 1                                                               #col with fixed effect in pred zcol <- 1                                                               #col with random effect in pred  prior <- list( a=ncol(y),                                           #non-informative...
2004 Sep 21
1
bubble plots
...quot;NF" "NFi" I do: > levels(data$etat) <- c(0, 2, -2, 1, -1) > data$etat <- as.numeric(as.vector(data$etat)) > C1 <- subset(data, sub=="C" & bloc=="1", select=c(x, y, etat)) > x11() > lset(theme = col.whitebg()) > bubble(C1, xcol = 1, ycol = 2, zcol = 3, xlab = "", ylab = "", main = "Bloc 1 - Substrat C", key.entries = min(C1[, 3]):max(C1[, 3]), maxsize=3) I then obtain "-2", "-1", "O", etc. as legend labels and cannot find argument making it possible to label...
2010 Oct 15
0
tessellation from biological data in spatstat
...lation using the following: a <- read.table("FOLLICLES.txt") win <- owin(c(0,512), c(0,512)) unitname(win) <- c("pixel", "pixels") b <- as.matrix(a, xrange=c(0,512), yrange=c(0,512)) unitname(b) <- c("pixel", "pixels") c <- im(b, xcol=seq(ncol(b)), yrow=seq(nrow(b)), unitname="pixels") d <- tess(image = c) plot(d) #I can then plot my ppp pattern on top of my tessellation using: plot(d) plot(data02, add=TRUE) #So far so good, but when I run for example: qb <- quadratcount(data02, tess = d) #I get the followin...
2013 Apr 04
2
custom startup/welcome message
hi everybody I wonder if there is a simple way, but not simple would be ok too, to customize info/welcome page at session start time? what I'd like to do is to put together simple short howto / dos & don'ts page for users, I'm thinking it would be great if it was possible many thanks [[alternative HTML version deleted]]
2012 Feb 23
1
segfault when using data.table package in conjunction with foreach
...table Loading required package: data.table data.table 1.7.10 For help type: help("data.table") data.table 1.7.10 For help type: help("data.table") *** caught segfault *** address 0x2ae93df90000, cause 'memory not mapped' Traceback: 1: .Call("dogroups", x, xcols, o__, f__, len__, jsub, SDenv, testj, byretn, byval, i, as.integer(icols), i[1, ivars, with = FALSE], if (length(ivars)) paste("i.", ivars, sep = ""), is.na(nomatch), verbose, PACKAGE = "data.table") 2: `[.data.table`(DT, , sum(sharing), by = "ID1,ID2")...
2013 Nov 01
1
Package(s) for making waffle plot-like figures?
Dear all, I am trying to make a series of waffle plot-like figures for my data to visualize the ratios of amino acid residues at each position. For each one of 37 positions, there may be one to four different amino acid residues. So the data consist of the positions, what residues are there, and the ratios of residues. The ratios of residues at a position add up to 100, or close to 100 (more on