search for: variance

Displaying 20 results from an estimated 3757 matches for "variance".

2005 Nov 30
8
Solving Systems of Non-linear equations
I am trying to write a function that will solve a simple system of nonlinear equations for the parameters that describe the beta distribution (a,b) given the mean and variance. mean = a/(a+b) variance = (a*b)/(((a+b)^2) * (a+b+1)) Any help as to where to start would be welcome. -- Scott Story Graduate Student MSU Ecology Department 319 Lewis Hall Bozeman, Mt 59717 406.994.2670 sstory at montana.edu
2012 May 13
1
how to write data using xlsReadWrite
...axes=FALSE, main="HL2") #-------------------------------------------------------------------# ##Get the dimension ##LH2 dimLH2 <- dim(y.modwt$LH2) dimLH2x <- dimLH2[1] dimLH2y <- dimLH2[2] varLH2xlist <- c(rep(0, dimLH2x)) varLH2ylist <- c(rep(0, dimLH2y)) ##Loop to get variance from x axis for(i in seq(dimLH2x)){ varLH2xlist[i] <- var(y.modwt$LH2[i,]) } ##Get the variance from the overall x variance varLH2x <- var(varLH2xlist) ##Loop to get variance from y axis for(i in seq(dimLH2y)){ varLH2ylist[i] <- var(y.modwt$LH2[,i]) } ##Get the variance from the...
2010 Oct 04
1
Fixed variance structure for lme
I have a data set with 50 different x values and 5 values for the sampling variance; each of the 5 sampling variances corresponds to 10 particular x values. I am trying to fit a mixed effect linear model and I'm not sure about the syntax for specifying the fixed variance structure. In Pinheiro's book my situation appears to be similar to the example used for varIdent, whe...
2012 May 13
4
write data using xlsReadWrite
...8), axes=FALSE, main="HL2") #-------------------------------------------------------------------# ##Get the dimension ##LH2 dimLH2 <- dim(y.modwt$LH2) dimLH2x <- dimLH2[1] dimLH2y <- dimLH2[2] varLH2xlist <- c(rep(0, dimLH2x)) varLH2ylist <- c(rep(0, dimLH2y)) ##Loop to get variance from x axis for(i in seq(dimLH2x)){ varLH2xlist[i] <- var(y.modwt$LH2[i,]) } ##Get the variance from the overall x variance varLH2x <- var(varLH2xlist) ##Loop to get variance from y axis for(i in seq(dimLH2y)){ varLH2ylist[i] <- var(y.modwt$LH2[,i]) } ##Get the variance from the ov...
2012 Jul 25
1
Between-group variance from ANOVA
I'm trying also to understand how to get the between-group variance out of a one-way ANOVA, but I'm beginning to think that in a sense, the variance does not exist. Emma said: *The model is response(i,j)= group(i)+ error(i,j)* Yes, if by group(i) you mean intercept + coefficient[i]. *we assume that group~N(0,P^2) and error~N(0,sigma^2) * Only the error is...
2011 Aug 25
2
within-groups variance and between-groups variance
Hello, I have been looking for functions for calculating the within-groups variance and between-groups variance, for the case where you have several numerical variables describing samples from a number of groups. I didn't find such functions in R, so wrote my own versions myself (see below). I can calculate the within- and between-groups variance for the Sepal.length variable...
2005 Jun 16
1
mu^2(1-mu)^2 variance function for GLM
Dear list, I'm trying to mimic the analysis of Wedderburn (1974) as cited by McCullagh and Nelder (1989) on p.328-332. This is the leaf-blotch on barley example, and the data is available in the `faraway' package. Wedderburn suggested using the variance function mu^2(1-mu)^2. This variance function isn't readily available in R's `quasi' family object, but it seems to me that the following definition could be used: }, "mu^2(1-mu)^2" = { variance <- function(mu) mu^2 * (1 - mu)^2 validmu <- function(mu) all(mu...
2004 Apr 13
2
Non-homogeneity of variance - decreasing variance
Hello all, I'm running very simple regression but face a problem of non-homogeneity of variance, but with a decreasing variance with increasing mean...I do not know how to deal with that. this relationship doesn't seem to be strong, but it's my first time to see something like that, and would like to know what to do if one day it becomes stronger. I tested just for fun some transforma...
2008 Aug 25
1
Displaying Equations in Documentation
...xample, the equation in the following: \details{ Calculated the R Squared for observed endogenous variables in a structural equation model, as well as several other useful summary statistics about the error in thoe variables. R Squared values are calculated as \deqn{R^{2} = 1-\frac{estimated variance}{observed variance}} Standardized error coefficients are then calculated as sqrt(1 - R^2). } While it shows normally using R CMD Rd2dvi, when I actually compile and load the package, displays as follows: R^{2} = 1-frac{estimated variance}{observed variance} I have also tried \deqn{R^{2} = 1...
2009 May 21
3
Problems with sample variance
Dear R users, I am a beginner to R. I generated 1000 samples with 15 data in each sample I tried finding the variance for each sample I used the code: m=1000;n=15 > r<-rnorm(15000) > for(i in 1:m){ x=data[,i] v=var(x)} what I got was just the variance for the last sample i.e. the 1000th sample but what I want is 1000 variance. Does anyone know what I did wrong? Thanks Chloe Smith -- View this mes...
2008 Sep 09
4
PCA and % variance explained
After doing a PCA using princomp, how do you view how much each component contributes to variance in the dataset. I'm still quite new to the theory of PCA - I have a little idea about eigenvectors and eigenvalues (these determine the variance explained?). Are the eigenvalues related to loadings in R? Thanks, Paul -- View this message in context: http://www.nabble.com/PCA-and---variance-e...
2007 Oct 01
0
Interpretation of residual variance components and scale parameters in GLMMs
Dear R-listers, I am working with generalized linear mixed models to quantify the variance due to two nested random factors, but have hit a snag in the interpretation of variance components. Despite my best efforts with Venables & Ripley 2002, Fahrmeir & Tutz 2001, R-help archives, Google, and other eminent sources (i.e. local R gurus), I have not been able to find a definitive...
2011 Nov 01
1
help with unequal variances
Hello, I have some patient data for my masters thesis with three groups (n=16, 19 & 20) I have completed compiling the results of 7 tests, for which one of these tests the variances are unequal. I wish to perform an ANOVA between the three groups but for the one test with unequal variance (<0.001 by both bartlett and levene's test) I am not sure what to do. I thought i would run ANOVA with bonferonni post-test for groups with equal variances, then for the test with...
2012 Jun 03
0
multiple variance structure in lmer giving zero variances
...am new to mixed models, new to R, and new to lme4 and am struggling to figure everything out. I have two questions that I am hoping someone can answer. 1) Am I using the correct random structure for my model? 2) Can someone help me figure out what is wrong with my syntax to code for random effect variance by treatment group? These questions somewhat go together but let me tackle number one first. I was told by our statistician (who unfortunately doesn’t know R well) that my model should include random effects for ID, ID*state, and ID*season. If my understanding of lme4 code is correct, my random s...
2016 Mar 24
3
summary( prcomp(*, tol = .) ) -- and 'rank.'
I agree with Kasper, this is a 'big' issue. Does your method of taking only n PCs reduce the load on memory? The new addition to the summary looks like a good idea, but Proportion of Variance as you describe it may be confusing to new users. Am I correct in saying Proportion of variance describes the amount of variance with respect to the number of components the user chooses to show? So if I only choose one I will explain 100% of the variance? I think showing 'Total Proportion of V...
2002 Aug 29
8
lme() with known level-one variances
...estimated regression coefficients and estimated standard errors for these pooled coefficients. In particular, I would like to estimate the model \beta_{i} = \mu + \eta_{i} + \epsilon_{i} \eta_{i} ~ iid N(0,\tau^2) and independent of the \epsilon_{i}, the latter themselves being independent with variances assumed known and equal to the squared standard errors reported in the regression output. I would like to use lme() to estimate \tau^2 by REML, and also get a sensibly weighted estimate for \mu from the fixed effects output. I am not sure how to do this. I have tried lme(fixed=beta~1,random=~1...
2012 Jun 26
1
How to estimate variance components with lmer for models with random effects and compare them with lme results
...on each individual. To test for an effect of either treatment or source as well as their interaction, I used a linear mixed effect model with family as random factor, i.e. lme(fixed=Trait~Treatment*Source,random=~1|Family,method="ML") so far so good, Now I have to calculate the relative variance components, i.e. the percentage of variation that is explained by either treatment or source as well as the interaction. Without a random effect, I could easily use the sums of squares (SS) to calculate the variance explained by each factor. But for a mixed model (with ML estimation), there are no...
2009 Nov 09
4
prcomp - principal components in R
Hello, not understanding the output of prcomp, I reduce the number of components and the output continues to show cumulative 100% of the variance explained, which can't be the case dropping from 8 components to 3. How do i get the output in terms of the cumulative % of the total variance, so when i go from total solution of 8 (8 variables in the data set), to a reduced number of components, i can evaluate % of variance explained, o...
2007 Jun 08
1
icc from GLMM?
...arding to icc (intraclass correlation) or many biologists refer it to as repeatability. It is very useful to get icc for many reasons and it is easy to do so from linear mixed-effects models and many packages like psy, psychometric, aod and irr have functions to calculate icc. icc = between-group variance/(between-group variance + residual variance) *residual variance = within-group variance However, I have yet to find a convincing reference or some sort on how to calculate icc from GLMM. I have found below: icc = between-group variance/(between-group variance + 1) *between-group variance = sca...
2011 Feb 28
1
Robust variance estimation with rq (failure of the bootstrap?)
I am fitting quantile regression models using data collected from a sample of 124 patients. When modeling cross-sectional associations, I have noticed that nonparametric bootstrap estimates of the variances of parameter estimates are much greater in magnitude than the empirical Huber estimates derived using summary.rq's "nid" option. The outcome variable is severely skewed, and I am afraid that this may be affecting the consistency of the bootstrap variance estimates. I have read that...