[R] matrix indexing

2005-08-18 Thread toka tokas
Dear R-users, I was wondering for the following: Let 'x' be a matrix and 'ind' and indicator matrix, i.e., x <- array(1:20, dim = c(4, 5)) ind <- array(c(1:3, 3:1), dim = c(3, 2)) I'd like to get (as a vector) the elements of 'x' which are not indexed by 'ind'. Since negative indices are not al

[R] plot question when type = "b" and pch is a vector

2005-10-02 Thread toka tokas
Dear R users, I've been struggling some days with the following problem: I'm interesting in producing the following plot x <- seq(0.01, 10, length = 20) plot(c(0, 10), c(-20, 20), type = "n", xlab = "x", ylab = expression(2 * alpha * log(x))) pch. <- rep(NA, length(x)) for(i in 1:4){

[R] builiding R from sources

2005-10-07 Thread toka tokas
Dear R users, I've been trying to build R from sources (in Windows) using Dr. Goto's BLAS, unsuccessfully! I've followed the instructions in Section 3.1.2-3.1.3 of "R Installation and Administration" manual (but maybe I did something wrong), but I keep receiving the following error: -- initially

[R] extracting p-values from lmer()

2005-12-05 Thread toka tokas
Dear R users, I've been struggling with the following problem: I want to extract the Wald p-value from an lmer() fit, i.e., consider library(lme4) n <- 120 x1 <- runif(n, -4, 4) x2 <- sample(0:1, n, TRUE) z <- rnorm(n) id <- 1:n N <- sample(20:200, n, TRUE) y <- rbinom(n, N, plogis(0.1 + 0.2 * x