[R] Matrix Question, calculate with 3 different matrices
rissa
rissa_r at gmx.ch
Wed Nov 6 20:59:01 CET 2013
Hi there
I've got a (I think) simple problem, but I just can't figure it out.
I've got 3 dataset (datasets attached below).
In 'Value' there is the measured mean value for every unit (SFZN, SGKN,
SGSN, SHLTN, SIK) and for every treatment (1 to 10).
In 'SE' is the Standard Error for every unit and every treatment.
In 'DF' is the degrees of freedom for every unit and every treatment.
First, I want to calculate the t-value for every unit and treatment based on
the null hypothesis Value= 0 and safe it in a new matrix that has the same
form like SE etc (value names in first column and Treatments in the header).
That means something like...
tvalue<-as.matrix(Value)/as.matrix(SE)
Next I want to calculate the critical t value (p=0.05, two-sided) in a
separate matrix (same form as SE etc). That means something like...
critical<-qf(0.05/2,as.matrix(DF))
And last. I want to compare 'tvalue' with 'critical' and give out
'significant' if abs(critical) >
abs(critical) or 'not' if it is not true and safe the results in a matrix
(same form as SE).
I know it's just a matrix question, but I'm a bit stuck.
P.S. Another question (not related to the above)
As far as I know in R the command var() calculates the sample variance (that
means 1/(N-1) ∑〖x-x ̅ 〗 ). Is there a way to tell R to calculate the
Population Variance (that means divided through N instead of N-1)
Kind regards
DF.txt <http://r.789695.n4.nabble.com/file/n4679907/DF.txt>
SE.txt <http://r.789695.n4.nabble.com/file/n4679907/SE.txt>
Value.txt <http://r.789695.n4.nabble.com/file/n4679907/Value.txt>
--
View this message in context: http://r.789695.n4.nabble.com/Matrix-Question-calculate-with-3-different-matrices-tp4679907.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list