similar to: a question about linear mixed model in R

Displaying 20 results from an estimated 900 matches similar to: "a question about linear mixed model in R"

2005 Jan 17
0
a question of mixed effect in R
Dear all, I have a question about mixed effect model in R. The data set has 5 variables, X(response),subject, times, repeat, indicator The model is X_hijk=a_h+Z_h*b_i+r(ij)+e_hijk , where h=0,1(indicator), i=1,...,n(subject), j=1,...,n_i(times within subject; nested effect),k=1,2,3(repeat). Z_h=1 if h=1 =0 if h=0 b_i~N(0,c^2) random effect of subject r(ij)~N(0,d^2) random effect of times
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
2005 Jun 14
1
within and between subject calculation
Dear helpers in this forum, I have the following question: 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 ...... and i want to calculate sum_{i=1}^k sum_{j=1}^{n_i}x_{ij}*y_{ij} is there a simple way to do this within and between subject summation in R?
2006 Nov 03
5
ANOVA in Randomized-complete blocks design
Dear all, I am trying to repeat an example from Sokal and Rohlfs "Biometry" -- Box 11.4, example of a randomized-complete-blocks experiment. The data is fairly simple: series genotype weight 1 pp 0.958 1 pb 0.985 1 bb 0.925 2 pp 0.971 2 pb 1.051 2 bb 0.952 3 pp 0.927 3 pb 0.891 3 bb 0.892 4
2001 Oct 09
1
PROC MIXED user trying to use (n)lme...
Dear R-users Coming from a proc mixed (SAS) background I am trying to get into the use of (n)lme. In this connection, I have some (presumably stupid) questions which I am sure someone out there can answer: 1) With proc mixed it is easy to get a hold on the estimated variance parameters as they can be put out into a SAS data set. How do I do the same with lme-objects? For example, I can see the
2008 Aug 13
3
issue building dataframes with matrices.
Hello, Is this a bug or a feature? I am using R 2.7.1 on Apple OS X. > y <- matrix(1:3,nrow=3) # y is a single-column matrix > df <-data.frame(x=1:3,y=y) > sapply(df,data.class) x y "numeric" "numeric" > df$yy <- y > sapply(df,data.class) x y yy "numeric" "numeric" "matrix"
2008 Aug 29
3
extract variance components
HI, I would like to extract the variance components estimation in lme function like a.fit<-lme(distance~age, data=aaa, random=~day/subject) There should be three variances \sigma_day, \sigma_{day %in% subject } and \sigma_e. I can extract the \sigma_e using something like a.fit$var. However, I cannot manage to extract the first two variance components. I can only see the results in
2011 Sep 25
1
Question about syntax in lm function
I encounters some codes in ggplot2 manual and confused with one of its lm syntax. The code is here: library(ggplot2) d <- subset(diamonds, carat < 2.5 & rbinom(nrow(diamonds), 1, 0.2) == 1) d$lcarat <- log10(d$carat) d$lprice <- log10(d$price) detrend <- lm(lprice ~ lcarat, data = d) d$lprice2 <- resid(detrend) mod <- lm(lprice2 ~ lcarat * color, data = d) # *** what
2009 Jan 08
1
cosinor analysis
Hallo, I didn´t found any facilities for Halbergs cosinor analysis in R. This analysis is well known in the Chronobiology as the least square approximation of time series using cosine function of known period (in my case of 24hours-period). I tried to write a script but crashed... Can you give me some advices, please!? Thanks Anne Berger Institute of Zoo- and Wildlife Research, Berlin, Germany
2004 Nov 23
2
IFELSE across large array?
Dear all, As our previous email did not get any response, we try again with a reformulated question! We are trying to do something which needs an efficient loop over a huge array, possibly functions such as apply and related (tapply, lapply...?), but can't really understand syntax and examples in practice...i.e. cant' make it work. to be more specific: we are trying to apply a mask
2011 Aug 26
1
matrix bands
Dear R developers, I was looking for a function analogous to base::diag() for getting and setting bands of a matrix. The closest I could find was Matrix::band(), but this was not exactly what I wanted for two reasons. Firstly, Matrix::band() returns a matrix rather than just the specified band. Secondly, Matrix::band() cannot be used for setting the values for a matrix band. Setting or
2011 Apr 27
6
Assignments inside lapply
Dear all I would like to ask you if an assignment can be done inside a lapply statement. For example I would like to covert a double nested for loop for (i in c(1:dimx)){ for (j in c(1:dimy)){ Powermap[i,j] <- Pr(c(i,j),c(PRX,PRY),f) } } to something like that: ij<-expand.grid(i=seq(1:dimx),j=(1:dimy)) unlist(lapply(1:nrow(ij),function(rowId) { return
2009 Oct 27
1
Rjava, RImageJ, and/or S4 question.
I am out of my league with this question. The following code starts the java imaging program ImageJ from within R, and displays an image (assuming ImageJ is installed on your computer). library(RImageJ) img <- IJ$openImage( file.choose() ) #pick an available .tif file img$show() # make the image object visible # An image is now displayed # find out about the objects involved >
2009 Oct 17
2
Recommendation on a probability textbook (conditional probability)
I need to refresh my memory on Probability Theory, especially on conditional probability. In particular, I want to solve the following two problems. Can somebody point me some good books on Probability Theory? Thank you! 1. Z=X+Y, where X and Y are independent random variables and their distributions are known. Now, I want to compute E(X | Z = z). 2.Suppose that I have $I \times J$ random number
2002 Dec 10
3
clogit and general conditional logistic regression
Can someone clarify what I cannot make out from the documentation? The function 'clogit' in the 'survival' package is described as performing a "conditional logistic regression". Its return value is stated to be "an object of class clogit which is a wrapper for a coxph object." This suggests that its usefulness is confined to the sort of data which arise in
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
2010 Feb 08
3
Hypercube in R
Dear all, Does anybody have an idea or suggestion how to construct (plot) 4-dimensional hypercube in R. Thanks in advance for any pointers. Regards, Andrej
2007 May 25
1
Speeding up resampling of rows from a large matrix
I'm trying to: Resample with replacement pairs of distinct rows from a 120 x 65,000 matrix H of 0's and 1's. For each resampled pair sum the resulting 2 x 65,000 matrix by column: 0 1 0 1 ... + 0 0 1 1 ... _______ = 0 1 1 2 ... For each column accumulate the number of 0's, 1's and 2's over the resamples to obtain a 3 x 65,000 matrix G. For those
2011 Feb 04
2
Avoiding two loops
Hello, I have a R code for doing convolution of two functions: convolveSlow <- function(x, y) { nx <- length(x); ny <- length(y) xy <- numeric(nx + ny - 1) for(i in seq(length = nx)) { xi <- x[[i]] for(j in seq(length = ny)) { ij <- i+j-1 xy[[ij]] <- xy[[ij]] + xi * y[[j]] } } xy } How do I reduce the 2
2011 Sep 12
6
Rv: Re: Cosinor Analysis
--- El lun, 12/9/11, Cristalina <pa100cia77@yahoo.es> escribió: De: Cristalina <pa100cia77@yahoo.es> Asunto: Re: [R-es] Cosinor Analysis Para: "Carlos Ortega" <coforfe@gmail.com> Fecha: lunes, 12 de septiembre, 2011 08:43 Hola,   Carlos, muchas gracias.   El método empleado en http://tolstoy.newcastle.edu.au/R/e6/help/09/01/0626.html (el url que se referencia