search for: varf

Displaying 9 results from an estimated 9 matches for "varf".

Did you mean: var
2007 Nov 07
2
creating a dynamic output vector
Let's say I have a program that returns variables whose names may be any string within the vector NAMES=c("varA","varB","varC","varD","varE","varF"..."varZ"), but I do not ever know which ones have actually been created. So in one example output, "varA", "varC", and "varD" could exist, but in another example output "varA", "varD", "varE",and "varF" exist,...
2006 Jun 28
2
Problem searching with special characters
I''m using Ferret on a Swedish website and I get some unexpected behaviour on searches containing the swedish charchters ???. An exampel, if I index a string "Varf?r fungerar det inte" ("Why doesnt it work" in swedish) and search for "f?r" I''ll get one (1) match. The expected behaviour would be no matches since ''f?r'' is part of the word ''varf?r''. And if I do a search for "varf?*&qu...
2009 Dec 01
3
Using two (...) in a function
...;- function ("DAP", "ALT", var1, var2){ #### My wish was to do somethin like function (...,...){ Vec <- matrix(c("DAP", "ALT")) ###here it would came the first (...) Vec <- matrix(c(...)) for (i in seq(along <- Vec)){ caracteristica <- Vec[i] varF <- if (caracteristica == "DAP") var1 else var2 ##here I would like to do something like #if ###caracteristica == variable1) variance1 else if (caracteristica == variable2) variance2 else ... } } but to turn this in a function, I would like to replace ("DAP", "ALT&q...
2009 Feb 24
1
Initialize varFunc in R
...nction in the model: model1 <- update(model0, weights=varIdent(form = ~1|species.group) ) I got no error message or note but when I printed model1 the output did not print any variance structure. It just didn't add any weights or variance structure and model1 = model0 If instead I ran the varFunc sepparately: varf1 <- varIdent(form = ~1|species.group) varf.init <- Initialize(varf1, data) model1 <- update(model0, weights=varf.init ) it works just fine, and I get an output with "Variance function: Structure: Different standard deviations per stratum" and a change in th...
2007 Oct 18
0
[R} Getting 'tilting' confidence intervals in R
...t;ABC" from boot.ci() and boot() in the Davison & Hinkley "boot" package. But I can't figure out how to use tilt.boot() to get the "tilting" confidence interval. Here's a program snippet: g = rgamma(N,shape=2,scale=3) #Generate a sample of N random deviates varf = function (x,i) { var(x[i]) } b = boot(g, varf, R=1000) boot.ci(b) fabc = function (x, w) { sum(x^2*w)/sum(w)-(sum(x*w)/sum(w))^2 } #wgt average (biased) variance abc.ci(g, fabc) #ABC method confidence interval bt = tilt.boot(g, varf, R=c(1000,1000,1000)) The bt object doesn't have a confi...
2007 Oct 18
0
Getting 'tilting' confidence intervals in R
...t;ABC" from boot.ci() and boot() in the Davison & Hinkley "boot" package. But I can't figure out how to use tilt.boot() to get the "tilting" confidence interval. Here's a program snippet: g = rgamma(N,shape=2,scale=3) #Generate a sample of N random deviates varf = function (x,i) { var(x[i]) } b = boot(g, varf, R=1000) boot.ci(b) fabc = function (x, w) { sum(x^2*w)/sum(w)-(sum(x*w)/sum(w))^2 } #wgt average (biased) variance abc.ci(g, fabc) #ABC method confidence interval bt = tilt.boot(g, varf, R=c(1000,1000,1000)) The bt object doesn't have a confi...
2012 Oct 08
0
Mininum number of resamples required to do BCa bootstrap?
...a relic of edited down a more complex script): > N <- 25 > s <- rlnorm(N, 0, 1) > require("boot") Loading required package: boot > v <- NULL # hold sample variance estimates > i <- 1 > v[i] <- var(s) # get sample variance > nReal <- 10 > varf <- function (x,i) { var(x[i]) } > fabc <- function (x, w) { # weighted average (biased) variance + sum(x^2 * w) / sum(w) - (sum(x * w) / sum(w))^2 + } > p <- c(.25, .75, .2, .8, .15, .85, .1, .9, .05, .95, .025, .975, .005, .995) > cl <- c(0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0...
2012 Oct 02
0
Possible error in BCa method for confidence intervals in package 'boot'
...a relic of edited down a more complex script): > N <- 25 > s <- rlnorm(N, 0, 1) > require("boot") Loading required package: boot > v <- NULL # hold sample variance estimates > i <- 1 > v[i] <- var(s) # get sample variance > nReal <- 10 > varf <- function (x,i) { var(x[i]) } > fabc <- function (x, w) { # weighted average (biased) variance + sum(x^2 * w) / sum(w) - (sum(x * w) / sum(w))^2 + } > p <- c(.25, .75, .2, .8, .15, .85, .1, .9, .05, .95, .025, .975, .005, .995) > cl <- c(0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0...
2012 Jul 18
1
fitting several lme sistematically
...fication of what I really have). Here you have the comands for the first model: library(nlme) set.seed(50) a<-data.frame(array(c(rep(1:10,10), rnorm(600)), c(100,7))) names(a)<-c("id", "varA", "varB", "varC", "varD", "varE", "varF") lme(varD ~ varA , random= ~1|id, data=a, na.action="na.exclude") I supossed that a simple sintaxis going through the variables of dataset "a" could cope with it: for(i in 2:4){ for(j in 5:7){ lme(a[,j] ~ a[,i] , random= ~1|id, data=a, na.action="na.exclude&quo...