Displaying 20 results from an estimated 24 matches for "mean2".
Did you mean:
means
2009 Jun 22
3
Calculating "row standard deviations"
Hi R-helpers,
I have been struggling with calculating row and column statistics,
e.g. standard deviation.
I know that
> datac$Mean<-rowMeans(datac,na.rm=TRUE)
will give me row means.
I have tried to replicate those row means with the apply function:
> datac$Mean2<-apply(datac,2,mean)
so that I can replace the function argument with "sd" (instead of
mean) to get standard deviations.
But, I'm running into this error:
> dim(datac)
[1] 17 271
> datac$Mean2<-apply(datac,2,mean)
Error in dimnames(x) <- dn :
length of 'dimnam...
2011 Aug 16
4
a question about lm on t-test.
Hi all:
I have a question about lm on t-test.
data(sleep)
I wanna perform t-test to test the difference between the 2 groups:
I can use:
t.test(extra~group)
The t.test result shows that:t = -1.8608; mean1=0.75,mean2=2.33
But I still wanna use:
summary(lm(extra~group))
Intercept=0.75,which is mean1,just the same as t.test.
group2=1.58 means the difference of the 2 groups,so
mean2=1.58+0.75=2.33,just the same as t.test.
And some parameters of group2(t value,Pr) are the same as t.test,since
group2 is the diffe...
2011 Aug 06
1
help with predict for cr model using rms package
...y response
cohort <- u$cohort
attach(all.data2.stand[u$subs,])
dd <- datadist(dd, cohort)
ord.cr <- lrm(y ~ cohort + mean.ova.energy + b.mean + r.mean, x=TRUE,
y=TRUE, na.action=na.delete)
summary(ord.cr)
p.cr <- predict(ord.cr, all.data2.stand, type='mean', codes=TRUE)
pred.mean2 <- data.frame(p.cr)
pred.mean2
> ord.cr <- lrm(y ~ cohort + mean.ova.energy + b.mean + r.mean, x=TRUE, y=TRUE, na.action=na.delete)
> summary(ord.cr)
Effects Response : y
Factor Low High Diff. Effect S.E.
mean.ova.energy...
2009 Aug 05
2
using ddply but preserving some of the outside data
...elow code won't work) (also, it, too,
seems clunkier than I would like)
sites<-c("a", "b", "c")
dates<-1:5
a.df<-expand.grid(sites=sites, dates=dates)
a.df$value<-runif(15,0,100)
a.df<-as.data.frame(a.df)
#now, I want to get the average of the
mean2<-function(df, date){
sub.df<-subset(df, df$dates-date<1 &
df$dates-date>-1 )
return(mean(df$value))
}
my.df<-data.frame(sites=NA, dates=NA, V1=NA)
for(a.date in a.df$dates){
new.df<-ddply(a.df, "sites", function(df) mean2 (df, a.date))
my.df<-merge(my.df...
2020 May 20
2
Precision of function mean,bug?
> On Wednesday, May 20, 2020, 7:00:09 AM EDT, peter dalgaard <pdalgd at gmail.com> wrote:
>
> Expected, see FAQ 7.31.
>
> You just can't trust == on FP operations. Notice also
Additionally, since you're implementing a "mean" function you are testing
against R's mean, you might want to consider that R uses a two-pass
calculation[1] to reduce floating
2009 Jun 23
1
ask for help xyplot
I want to make such plot using the following data set
plot Mean with Sd(+/-) by Dim group by Lac
here is data
Does anyone know how to plot using xyploy
Thanks,
Aimin
Mean Sd Var Min Max Dim Lac
704 44.00000 NA NA 44.0 44.0 -30 3
703 45.92000 9.5484030 91.1720000 60.0 34.4 -30 4
702 57.40000 NA NA 57.4 57.4 -30
2010 Nov 23
1
Barplot and plot means with confidence intervals in the same plot
...entered with the figures.
An example of my data:
mean1<-cbind(55.5,56.42,56.38,55.28)
SD1<-cbind(10,9 ,7 ,3)
x<-rbind(mean1,SD1)
colnames(x)<-c("Autumn","Spring","Summer","Winter")
rownames(x)<-c("MeanProts","SD")
mean2<-cbind(10,15,9,8)
SD2<-cbind(2,3 ,1 ,5)
y<-rbind(mean2,SD2)
colnames(y)<-c("Autumn","Spring","Summer","Winter")
rownames(y)<-c("MeanDNA","SD")
Thanks in advance.
Nacho
--
Ignacio Alborés Blanes
Grupo de Investig...
1999 Mar 07
1
ANOVA f-test
I have a rather basic question. How can I get R to generate a ANOVA table
and a f-value for a hypothesis test such as:
Data: group1 values: 5.2 4.5 6.0 6.1 6.7 5.8
group2 values: 6.5 8.0 6.1 7.5 5.9 5.6
...
H0: mean1 = mean2 = mean3 = mean4
HA: at least two means different
where I want to evaluate using a f test statistic?
F = MSTr/MSE
I'd like a table similar to one that Minitab would produce:
Df Sum Sq Mean Sq F value
mean1
mean2
mean3
Error
Secondly, how can do a second evaluation using a multip...
2003 Dec 04
6
get mean of several rows
...nd, I gave up:
I have a 2-dimensional array, and I know how to split it into its rows
and how to get the mean for every row using 'sapply'.
But what I want is to calculate the mean over the first n rows, and then
the second n rows, etc., so that I get a vector like:
v == mean1(row 1:5), mean2(row6:10),...
(trivial, you might say. I find it rather mind-boggling, though: I tried
to get the mean from the array before splitting it, after splitting it,
looping through it with for-loops...I feel like an idiot by now; looks
like I missed a crucial point of how 'R' works.)
Thanks a...
2010 Oct 20
1
Generate variable with Bivariate Normal Distribution
Dear All
I want to generate variable with Bivariate Normal Distribution by
use mean1 = a, variance1 = b, mean2 = c, variance2 = d, rho = e.
How I can do this.
Many Thanks.
IRD
[[alternative HTML version deleted]]
2020 May 21
0
Precision of function mean,bug?
...t; function you are
>>> testing
>>> > against R's mean, you might want to consider that R uses a two-pass
>>> > calculation[1] to reduce floating point precision error.
>>>
>>> This one is important.
>>>
>>> FWIW, matrixStats::mean2() provides argument refine=TRUE/FALSE to
>>> calculate mean with and without this two-pass calculation;
>>>
>>> > a <- c(x[idx],y[idx],z[idx]) / 3
>>> > b <- mean(c(x[idx],y[idx],z[idx]))
>>> > b == a
>>> [1] FALSE
>>> &g...
2009 Jan 27
1
Problem with RMA using limma, oligo and pdInfoBuilder packages
...> d <- rowMeans(e[, index1]) - rowMeans(e[, index2])
> design <- model.matrix(~factor(eset$Key))
> fit <- lmFit(eset, design)
> ebayes <- eBayes(fit)
> sample <- row.names(ebayes)
> Pvalue <- ebayes$p.value[,2]
> Mean1 <- rowMeans(e[,index1])
> Mean2 <- rowMeans(e[,index2])
> sd1 <- apply(e[,index1], 1, "sd")
> sd2 <- apply(e[,index2], 1, "sd")
> csv <- read.csv(file="D:/Anne-Marie/Doctorat/puces ADN macrophages/puces
rat/Annie
Dube/Analyse/RaGene-1_0-st-v1.na27.rn4.transcript.header.DOS.csv&quo...
2011 Sep 15
1
How to compute the power of a wilcoxon test?
...ble for a wilcoxon test. After research about the
appropriateness, I am pretty sure that a wilcoxon test is the right tool for
my case. But how to compute the power of the test is still an unanswered
question bothering me.
The basic stats of my two paired samples are:
mean1 = 0.0032, sd1 = 0.012
mean2 = 0.00042, sd2 = 0.0016
sample size = 366
Could anyone help? Thank you in advance.
--
View this message in context: http://r.789695.n4.nabble.com/How-to-compute-the-power-of-a-wilcoxon-test-tp3815616p3815616.html
Sent from the R help mailing list archive at Nabble.com.
2010 Aug 18
2
functions and multiple levels
Hi,
I am trying to write a function;
I want to subtract the mean of each class in level 2 from the mean of each
class in level 1 and square the answer, eg.....
level.1 level.2 observation
1 1 0.5
1 1 0.2
1 2 0.6
1 2 0.4
2 3
2002 Mar 01
3
Power of t-test in R vs. S-PLUS
...sd = 0.2
sig.level = 0.01
power = 0.8
alternative = two.sided
NOTE: n is number in *each* group
S-PLUS 2000 Professional Release 2:
> normal.sample.size(n1=5, n2=5, mean=0, sd1=0.2, sd2=0.2, power=0.8,
alpha=0.01, alternative="two.sided")
mean1 sd1 mean2 sd2 delta alpha power n1 n2 prop.n2
1 0 0.2 0.4322771 0.2 0.4322771 0.01 0.8 5 5 1
------------------------------------------
Dr. J?rn Quedenau
Coordinator Data Management Bioinformatics
Metanomics GmbH & Co. KGaA
Tegeler Weg 33, D-10589 Berlin, Germany
Tel +49 30 34807 125,...
2017 Aug 24
1
Problem in optimization of Gaussian Mixture model
Hello,
I am facing a problem with optimization in R from 2-3 weeks.
I have some Gaussian mixtures parameters and I want to find the maximum in
that
*Parameters are in the form *
mean1 mean2 mean3 sigma1 sigma2 sigma3 c1 c2 c3
506.8644 672.8448 829.902 61.02859 9.149168 74.84682 0.1241933
0.6329082 0.2428986
I have used optima and optimx to find the maxima, but it gives me value
near by the highest mean as an output, for example 830 in the above
parameter...
2010 Mar 20
2
EM algorithm in R
Please help me in writing the R code for this problem. I've been solving this
for 4 days. It was hard for me to solve it. It's a simulation problem in R.
The problem is
My true model is a normal mixture which is given as
0.5 N(-0.8,1) + 0.5 N(0.8,1). This model has two components.
I will get a random sample of size 100 from this model. I will do this 300
times.
That means, I will have
2006 Feb 15
2
aggregate data.frame using column-specific functions
Dear Colleagues,
does anybody know how to aggregate a data.frame using different functions for different columns?
Sincerely
___________________
Markus Preisetanz
Consultant
Client Vela GmbH
Albert-Roßhaupter-Str. 32
81369 München
fon: +49 (0) 89 742 17-113
fax: +49 (0) 89 742 17-150
mailto:markus.preisetanz@clientvela.com
2010 Oct 08
1
Meta-analysis question
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20101008/0bc9c0cc/attachment.pl>
2006 Aug 07
3
Finding points with equal probability between normal distributions
Dear mailing list,
For two normal distributions, e.g:
r1 =rnorm(20,5.2,2.1)
r2 =rnorm(20,4.2,1.1)
plot(density(r2), col="blue")
lines(density(r1), col="red")
Is there a way in R to compute/estimate the point(s) x where the density of the
two distributions cross (ie where x has equal probability of belonging to
either of the two distributions)?
Many Thanks
Eleni