Displaying 20 results from an estimated 500 matches similar to: "loops & sampling"
2005 Nov 11
0
Fwd: Re: conditional coloring of image labels
---------- Forwarded Message ----------
Subject: Re: [R] conditional coloring of image labels
Date: Friday 11 November 2005 1:04 pm
From: jim holtman <jholtman at gmail.com>
To: Jake Michaelson <jjmichael at cc.usu.edu>
Use 'mtext':
genes=cbind(ABC1=c(3,4,4,5,6,3), ABC2=c(4,3,4,7,7,8), ABC3=c(8,7,8,6,3,2))
###plot the image
image(1:nrow(genes), 1:ncol(genes), genes, axes =
2005 Nov 11
1
conditional coloring of image labels
Hi all,
I am interested in plotting a heatmap of a set of genes. I would like the
text labels of these genes to be colored red rather than black if they meet
certain statistical criteria (using an if statement). I'm not sure how to
change individual color labels without changing them all. Can anyone provide
some insight on how to do this?
Thanks in advance,
Jake
2010 Jul 20
1
p-values pvclust maximum distance measure
Hi,
I am new to clustering and was wondering why pvclust using "maximum"
as distance measure nearly always results in p-values above 95%.
I wrote an example programme which demonstrates this effect. I
uploaded a PDF showing the results
Here is the code which produces the PDF file:
-------------------------------------------------------------------------------------
s <-
2007 Oct 25
2
Find duplicates and save their max value
Hi,
maybe someone can help me with this:
I have a matrix of genes and values:
GeneName Value
Abc1 10
Abc2 11
Bbc1 -5
Bbc31 2
Ccd 5
Ccd -2
Ccd 7
Dda 5
Dda 10
..... .....
Zzz3 -1
I would like to
2008 Apr 13
0
R project
Hi,I am currently doing a project in which we are to investigate the size and power of three different one sample tests over three different distributions using a number of different sample sizes and values for mu1. I have written a function and was trying to get my answer for each test into the right position in an array so the output is the power of each combination of test, distribution, sample
2012 Jan 19
1
snow - bootstrapped correlation ranking
I wonder if someone could help me adjusting the following code to parallelized snow code:
#Creating a data set (not needed to be parallel)
n<-100
p<-100
x<-matrix(rnorm(n*p),p)
y<-rnorm(n)
# Bootstrapping
nboot<-1000
alpha<-0.05
rhoboot <- array(0, dim=c(p,nboot))
bootranks <- array(0, dim=c(p,nboot))
bootsamples <- array( floor(runif(n*nboot)*n+1), dim=c(n,nboot))
for
2008 Dec 16
1
renaming factor-labels / add factors etc.
Hi,
how can I change a defined factor-variable?
Like adding levels, renaming existing levels or merge several levels
of a factor to one level?
For example; following factor-variable is given:
x <- factor(c("xyz1", "abc1", "xyz2", "abc2"))
How can I add the level fgh?
And how can I merge "xyz1" and "xyz2" to one level?
And
2018 May 22
0
Bootstrap and average median squared error
Hello,
If you want to bootstrap a statistic, I suggest you use base package boot.
You would need the data in a data.frame, see how you could do it.
library(boot)
bootMedianSE <- function(data, indices){
d <- data[indices, ]
fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d)
ypred <- predict(fit)
y <- d$crp
median(y - ypred)^2
}
dat <-
2018 May 21
2
Bootstrap and average median squared error
Dear R-experts,
I am trying to bootstrap (and average) the median squared error evaluation metric for a robust regression. I can't get it. What is going wrong ?
Here is the reproducible example.
#############################
install.packages( "quantreg" )
library(quantreg)
crp <-c(12,14,13,24,25,34,45,56,25,34,47,44,35,24,53,44,55,46,36,67)
bmi
2011 Apr 03
2
:HELP
Hello,
I want to sum first three terms of each column of matrix.
But I don't calculate with "apply" function.
skwkrt<-function(N=10000,mu=0,sigma=1,n=100,
nboot=1000,alpha=0.05){
x<-rnorm(N,mu,sigma)#population
samplex<-matrix(sample(x,n*nboot,replace=T),nrow=nboot)
#...
}
is that: suppose a is a 5x2 matrix.
a={1,2,3,4,5
2011 Feb 24
1
parallel bootstrap linear model on multicore mac (re-post)
Hello all,
I am re-posting my previous question with a simpler, more transparent,
commented code.
I have been ramming my head against this problem, and I wondered if
anyone could lend a hand. I want to make parallel a bootstrap of a
linear mixed model on my 8-core mac. Below is the process that I want to
make parallel (namely, the boot.out<-boot(dat.res,boot.fun, R = nboot)
command).
2008 Dec 03
1
help on tapply using sample with differing sample-sizes
Hello, My question likely got buried so I am reposting it in the hopes that someone has an answer. I have thought more about the question and modified my question. I hope tha
my specific question is:
I am attempting to create a bootstrap procedure for a finite sample using the theory of Rao and Wu, JASA (1988) that replicates within each strata (h) n_h - 1 times. To this end, I require a
2011 May 16
1
Matrix manipulation in for loop
Hi all,
I have a problem with getting my code to do what I want!
This is the code I have:
create.means.one.size<-function(nsample,var,nboot){
mat.x<-matrix(0,nrow=nboot,ncol=nsample)
for(i in 1:nboot){
mat.x[i,]<-sample(var,nsample,replace=T)
}
mean.mat<-rep(0,nboot)
for(i in 1:nboot){
mean.mat[i]<-mean(mat.x[i,])
}
sd.mean<-sd(mean.mat)
return(mean.mat)
}
where
2005 Jun 23
1
errorest
Hi,
I am using errorest function from ipred package.
I am hoping to perform "bootstrap 0.632+" and "bootstrap leave one out".
According to the manual page for errorest, i use the following command:
ce632[i]<-errorest(ytrain ~., data=mydata, model=lda,
estimator=c("boot","632plus"), predict=mypredict.lda)$error
It didn't work. I then tried the
2014 Jun 16
2
Print files which would be transfered by rsync (when syncing two directories)
Hi together,
after I read "very often" without even a tiny bit of a contradiction, I
start to have the feeling I have a basic misunderstanding of rsync.
Assume one want to get a list of files which would have been transfered
by rsync if rsync was requested to sync directories X and Y and one does
<code>
X=`mktemp`
echo "abc" > $X/1
echo "abc1" > $X/2
2011 Apr 01
2
Unable to join to Windows 2003 PDC using samba 3.5.8 from a linux machine!!
Hi all,
I am using samba 3.5.8 on a linux machine.
I am not able to join the domain of a windows 2003 server in ADS mode.
I am getting the following error message:
# /usr/local/samba/bin/net ads join -U Administrator%password -I 10.25.66.71
Failed to join domain: failed to find DC for domain ABCDOM.PQR.COM
#
I am not sure what the issue here.
It works absolutely fine when I try to join the
2012 Nov 14
2
error data frame
Hallo everybody!
I am trying to perform a TiTAN (Baker & King 2010) analysis with R 2.14.1. I
have come that far:
h89Abund <- read.csv("Fish89Abund.csv")
> names (Fish89Abund)
[1] "StationCode" "Abramisbrama"
"Alburnoidesbipunctatus" "Alburnusalburnus"
[5] "Ameiurusmelas"
>
2019 Jun 02
3
Incluir un rango de varias variables explicativas a un modelo
Hola,
Quiero especificar una ecuación con varias variables explicativas de una
manera eficiente sin necesidad de escribir todas y cada una. Tengo un
conjunto de variables (junto con otras) dentro de una base de datos que se
llaman pot23 pot311 pot312 pot 316 pot317........... pot80. No
necesariamente están secuenciadas. Quisiera saber cómo indicar que incluya
todas las variables de pot23 a pot80
2013 Jan 14
2
Reportar Bondad de ajuste de un Modelo No Lineal
Hola:
tengo un pequeño problemita que es más bien estadístico que específico de R, pero de todos modos espero me puedan dar una mano.
Quiero encontrar una forma de reportar la Bondad de ajuste de un modelo No Lineal. Estuve buscando y leyendo y parece que tal cosa no es posible o al menos no es fiable, desde el punto de vista estadístico.
El tema es que quiero mandar un trabajo a una
2007 Dec 11
1
postResample R² and lm() R²
Hello,
I'm with a conceptual doubt regarding Rsquared of both lm() and
postResample(library caret).
I've got a multiple regression linear model (lets say mlr) with anR² value
of 67.52%.
Then I use this model pro make predictions with predict() function using the
same data as input , that is, use the generated model to predict the value
associated with data that I used as input.
Next, if