similar to: Problem with indexing

Displaying 20 results from an estimated 10000 matches similar to: "Problem with indexing"

2003 Apr 02
2
lme parameterization question
Hi, I am trying to parameterize the following mixed model (following Piepho and Ogutu 2002), to test for a trend over time, using multiple sites: y[ij]=mu+b[j]+a[i]+w[j]*(beta +t[i])+c[ij] where: y[ij]= a response variable at site i and year j mu = fixed intercept Beta=fixed slope w[j]=constant representing the jth year (covariate) b[j]=random effect of jth year, iid N(0,sigma2[b]) a[i]=random
2005 Jun 15
2
need help on computing double summation
Dear helpers in this forum, This is a clarified version of my previous questions in this forum. I really need your generous help on this issue. > Suppose I have the following data set: > > id x y > 023 1 2 > 023 2 5 > 023 4 6 > 023 5 7 > 412 2 5 > 412 3 4 > 412 4 6 > 412 7 9 > 220 5 7 > 220 4 8 > 220 9 8 > ...... > Now I want to compute the
2008 Mar 15
2
Please find the error in my code
hello everybody I use the following code for my programming & it runs with the error as specified below.Any help that would disolve the error will be highly appreciated. Thanks in advance my code looks like this #### R programme for simulating the power of the two sample t test vs various #### non-parametric alternatives sim.size <- 200 sample.size <- 10 set.seed(231) mu1 <- 0 delta
2007 May 17
1
use loop or use apply?
Hi, I have two matrices, A (axd) and B (bxd). I want to get another matrix C (axb) such that, C[i,j] is the Euclidean distance between the ith row of A and jth row of B. In general, I can say that C[i,j] = some.function (A[i,], B[j,]). What is the best method for doing so? (assume a < b) I have been doing some exploration myself: Consider the following function: get.f, in which,
2004 Nov 16
1
Pairwise Distances -- How to vectorize the loop
R-List, I'm trying to compute pairwise distances among pairs of observations, which each pair containing data from 2 groups. There are more than 100000 unique pairs. I have programmed a distance function that has three parameters, a vector of covariates from the ith observation in Group 1, a vector of covarites from the jth observation in Group 2, and a weighting matrix. I have used
2006 Oct 02
1
multilevel factor model in lmer
Hello -- I am curious if lmer can be used to fit a multilevel factor model such as a two-parameter item response model. The one parameter model is straightforward. A two-factor model requires a set of factor loadings multiplying a single random effect. For example, a logit model for the ith subject responding correctly to the jth item (j=1,..,J) is logit[p(ij)] = a1*item1(i) + ... + aJ *
2007 Oct 29
1
How to test combined effects?
Suppose I have a mixed-effects model where yij is the jth sample for the ith subject: yij= beta0 + beta1(age) + beta2(age^2) + beta3(age^3) + beta4(IQ) + beta5(IQ^2) + beta6(age*IQ) + beta7(age^2*IQ) + beta8(age^3 *IQ) +random intercepti + eij In R how can I get an F test against the null hypothesis of beta6=beta7=beta8=0? In SAS I can run something like contrast age*IQ 1,
2002 Dec 06
6
fast code
Hello, I have two vectors x1 and x2 both in increasing order. I want to select the x1[j]th entry which is the max min of the x2[i]th entry. I can do this using if and for statements but is there a quick way to do it without running a loop? Thank you in advance, Pantelis
2009 Dec 28
2
Modified R Code
Dear R helpers,   I have following input files. (Actually they are more than 10 rates but here i am considering only 2 rates to write my problem)   rate1.csv min1        max1            min2          max2          min3           max3 1.05        1.30               1.30          1.65             1.65          1.99   rate2.csv min1        max1            min2          max2          min3          
2007 Sep 18
0
[LLVMdev] 2.1 Pre-Release Available (testers needed)
On Saturday 15 September 2007, Tanya Lattner wrote: > 2) Download llvm-2.1, llvm-test-2.1, and the llvm-gcc4.0 source. > Compile everything. Run "make check" and the full llvm-test suite > (make TEST=nightly report). I tried to do this, but ran into trouble. LLVM itself compiled fine. GCC compilation is broken when Java support is enabled. I can file a detailed bug report
2005 Nov 04
1
t test on data frame
Hi, I have constructed a dataframe as follows: Oil <- rep(c("Oil1","Oil2","Oil3"),8) Comp <- rep(rep(c("C1","C2"),c(4,4)),3) Mth <- rep(c("M1","M1","M2","M2"),6) Meas <- rep(c(1,2),12) Result <- rnorm(24,mean=100, sd=5) df <- data.frame(Oil, Comp, Mth, Meas, Result) The same compound
2008 Jan 16
2
old master.pid prevents dovecot startup
Summary ======= After an unclean shutdown the file /var/run/dovecot/master.pid remained behind. This prevented dovecot from starting, and gave a misleading error message. To be more resilient and fault-tolerant, I recommend that dovecot also check the validity of the PID in /var/run/dovecot/master.pid in order to determine whether or not another dovecot process is running. Detail ====== In
2013 Apr 06
1
Replace missing values within a group with the non-missing value
I have a large dataset organised in choice groups see below. Each choice represents a separate occasion with 1 product chosen out of the 6 offered.            +-------------------------------------------------------------------------------------------------+      | dn   obs   choice      acid   br                 date       cdate   situat~n   mth   year   set |     
2007 Nov 15
5
Multiply each column of array by vector component
Hi, I've got an array, say with i,jth entry = A_ij, and a vector, say with jth entry= v_j. I would like to multiply each column of the array by the corresponding vector component, i,e. find the array with i,jth entry A_ij * v_j This seems so basic but I can't figure out how to do it without a loop. Any suggestions? Michal.
2013 Apr 06
2
Replace missing value within group with non-missing value
Dear List members I have a large dataset organised in choice groups see sample below +-------------------------------------------------------------------------------------------------+ | dn obs choice acid br date cdate situat~n mth year set |
2007 Apr 23
1
How to get LSMEANS from linear mixed model?
Hi there, I am trying to run simulations using R with linear mixed model (lme). There are two factors in my fixed effect model, educ (treatment and control) and mth (visit 1, 2, and 3). What I want to obtain is the estimated treatment difference (treatment - control) at visit 3, plus the standard error and p-value. This can be easily obtained in SAS using lsmeans or estimate statements, but I
2008 Mar 25
0
Mixed-effects models: question about the syntax to introduce interactions
hello everyone, I would like to as for advice for the use of ?lmer? (package ?lme4?) and writing the proper syntax to best describe my data using a mixed-effects model. I have just started to use these models, and although I have read some good examples (Extending the Linear Model with R, Faraway 2005; and the R book, Crawley 2007), I am still not sure of the syntax to test my hypothesis.
2011 Sep 28
1
Multiplying a list of matrices with a vector
Hi all! I have a list of matrices and I want to multiply the ith element of the list with the ith element of a another vector. That is, > LL <- list(A=diag(3),B=diag(3),C=diag(3)) > vec <- 1:3 > for(i in 1:3) + { + LL[[i]] <- LL[[i]]*vec[i] + } > LL $A [,1] [,2] [,3] [1,] 1 0 0 [2,] 0 1 0 [3,] 0 0 1 $B [,1] [,2] [,3] [1,] 2 0
2009 Jan 06
5
Using apply for two datasets
I can run one-sample t-test on an array, for example a matrix myData1, with the following apply(myData1, 2, t.test) Is there a similar fashion using apply() or something else to run 2-sample t-test with datasets from two groups, myData1 and myData2, without looping? TIA, Gang
2010 Aug 28
1
star models
Hi, I am traying to implement an STAR model, but I have some problems. I am following the instruction of the model, that they are in: http://bm2.genes.nig.ac.jp/RGM2/R_current/library/tsDyn/man/star.html that they are from: http://bm2.genes.nig.ac.jp/RGM2/pkg.php?p=tsDyn The model is: star(x, m=2, noRegimes, d = 1, steps = d, series, rob = FALSE, mTh, thDelay, thVar, sig=0.05, trace=TRUE,