search for: cmatrix

Displaying 20 results from an estimated 20 matches for "cmatrix".

Did you mean: matrix
2002 Jun 26
2
contrast matrix in package multcomp
...to test trial3 against all other trials and build the following contrast matrix C: > C [,1] [,2] [,3] [,4] [,5] [1,] 1 0 -1 0 0 [2,] 0 1 -1 0 0 [3,] 0 0 -1 1 0 [4,] 0 0 -1 0 1 but I got the error: > summary(simtest(adiff ~ trial, cmatrix=C)) Error in simtest.formula(adiff ~ trial, cmatrix = C) : dimensions of x and cmatrix do not match Does anybody know what went wrong? Thanks, Sven -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-...
2011 Feb 20
2
Problem using F77_CALL(dgemm) in a package
...operations in my C code. As I have never done that before, I'm trying to write some simple examples to make sure I understand the basics. I am stuck on the first one. I'm trying to write a function to multiply two matrices using the blas routine dgemm. The name of my example package is CMATRIX. My code is as follows. I have a file matrix.c in my src directory: #include <R.h> #include <R_ext/Utils.h> #include <R_ext/Lapack.h> #include <R_ext/BLAS.h> //Computes C = A*B void R_matrix_multiply(double * A, double * B, int * m, int *n, int * p, double * C){ double...
2003 Aug 06
1
S4 methods bug in naming of slots (PR#3665)
Hello, I am using R 1.7.1 on a Redhat Linux machine, version 7.3. The following works fine: setClass("ok", representation( "A" = "matrix", "Cmatrix" = "matrix")) new("ok", "A" = diag(4), "Cmatrix" = diag(4)) But the following doesn't work: setClass("notok", representation( "A" = "matrix", "C" = "matrix")) new("notok&q...
2006 Jul 11
2
Multiple tests on 2 way-ANOVA
...2005, p. 509) cm1 <- matrix(c(0, 1, 0, 0, 0, 1), nrow = 2, ncol=3, byrow=TRUE, dimnames = list(c("A", "B"), c("C.1", "C.2", "C.3"))) # cm1 = contrast matrix for main effects v1 <- csimint(estpar=c(100, 6, 5), df=4*n-3, covm=cov1*sigma^2/n, cmatrix=cm1, conf.level=0.95) summary(v1) The adjusted p-values are almost the Bonferroni p-values. If I understood right: You need not to adjust for multiple testing on main effects in a 2x2 factorial design assuming the absence of interaction. I do not think that there is a bug, I want to understand...
2012 Jul 19
1
Change log(J) to log(J+1) to stop log(0) from occurring in harModel
...J = J[,1]; teststats = ABDJumptest(RV=RM1,BPV=RM2,TQ=TQ ); }else{ jtest = match.fun(jumptest); teststats = jtest(data,...) } Jindicators = teststats > qnorm(1-alpha); J[!Jindicators] = 0; # Get continuus components if necessary RV measures if necessary: Cmatrix = matrix( nrow = dim(RVmatrix1)[1], ncol = 1 ); Cmatrix[Jindicators,] = RVmatrix2[Jindicators,1]; #Fill with robust one in case of jump Cmatrix[(!Jindicators)] = RVmatrix1[(!Jindicators),1]; #Fill with non-robust one in case of no-jump # Aggregate again: Cmatrix &lt...
2005 Mar 09
1
multiple comparisons for lme using multcomp
...s 0.8 76 Al800 s 0.8 77 Al800 s 0.7 > attach(tab) > library(nlme) > lm1<-lme(response~treatment,random=~1|box) > library(multcomp) Loading required package: mvtnorm > # first way to do (seem uncorrect) > summary(csimtest(coef(lm1),vcov(lm1),cmatrix=contrMat(table(treatment), type="Tukey"),df=59)) Error in csimtest(coef(lm1), vcov(lm1), cmatrix = contrMat(table(treatment), : estpar not a vector > #indeed > coef(lm1) (Intercept) treatmentAl200 treatmentAl400 treatmentAl600 treatmentAl800 a 1.546679 -0.1648540 -...
2003 May 14
1
Multiple comparison and lme (again, sorry)
...mate the model gmod <- glm( z ~ group, family=binomial(link = "logit")) summary(gmod) # exclude the intercept # Should be the following, but does not work due to a confirmed # bug in the CRAN-binary version 5.10 #summary(csimtest(coef(gmod)[2:3], vcov(gmod)[2:3,2:3], # cmatrix=diag(2), df=27,asympt=T)) summary(csimtest(coef(gmod)[2:3], vcov(gmod)[2:3,2:3], cmatrix=diag(2), df=27)) ------- This works and can be extended to to lme, but only gives TWO of the three possible Tukey contrasts. Setting type="Tukey" does not work, as by assigning to co...
2003 May 19
1
multcomp and glm
...y to cross some features than others and am using csimtest in the package multcomp to do so. x <- coef(model) var.cov <- vcov(model) df <- model$df.residual contrast.matrix <- contrMat(rep(2,length(x), type = "Tukey") post.hoc <- csimtest(estpar = x, df=df, covm = var.cov, cmatrix = contrast.matrix) summary(post.hoc) My questions are: (1) Have I entered my parameters for the posthoc analysis correctly and does it matter which categorical variable I use as my reference category? (2) How do I omit the continuous variable "null.cross" from the list of multiple compa...
2004 Aug 13
5
simtest for Dunnett's test
...,28.5,30,30.32,30,19.879,30.716,25 .2,30,30,30,30,30,14.063,28.811,30.396,30.609,30,14.1,30,30,30,26.322,30.386 ,28.583,15.77,29.341,30,17.1,30,30,30,30,20.451,30,23.967,30.507,30,30,30,27 .7,30,28.5,22.568,32.379,30.374,28.263) h<-factor(c(rep(1:11, each = 10))) result<-summary(simtest(y ~ h,cmatrix=cbind(0,m))) rownames(result$estimate) result I want to compare my results with the results obtained with SigmaStat Software. In my results, i retrieve a correct q' value with the simtest t value How can i say if P<0.05 like the SigmStat results? Can i use p raw value, p bonf value, p adj...
2012 Jul 19
1
Switching log(J) to log(J+1) to avoid log(0) in HAR-RVJ model
...J = J[,1]; teststats = ABDJumptest(RV=RM1,BPV=RM2,TQ=TQ ); }else{ jtest = match.fun(jumptest); teststats = jtest(data,...) } Jindicators = teststats > qnorm(1-alpha); J[!Jindicators] = 0; # Get continuus components if necessary RV measures if necessary: Cmatrix = matrix( nrow = dim(RVmatrix1)[1], ncol = 1 ); Cmatrix[Jindicators,] = RVmatrix2[Jindicators,1]; #Fill with robust one in case of jump Cmatrix[(!Jindicators)] = RVmatrix1[(!Jindicators),1]; #Fill with non-robust one in case of no-jump # Aggregate again: Cmatrix <- a...
2004 May 31
0
Doubts on anova and use of contrasts in multcomp package
...9;r1 vs (r2,r3)/e1', 'r2 vs r3/e1', 'r1 vs (r2,r3)/e2', 'r2 vs r3/e2') lim1 = lm(y ~ aux, data = df) print(anova(lim1)) tc1 = simtest(y ~ aux, data = df, conf.level = 0.9, alternative = 'less', eps = 1e-04, cmatrix = C) print(summary(tc1)) #===Below: verifying E effect in R levels (already analized in av2) # (with auxiliary variable - aux) # a: e1/r1 # c: e1/r2 # e: e1/r3 # b: e2/r1 # d: e2/r2 # f: e2/r3 #a b c d e f C1 = c(1, -1, 0, 0, 0, 0) # e1 vs e2/r1 C2 = c(0, 0, 1, -1...
2006 Feb 07
1
post-hoc comparisons following glmm
Dear R community, I performed a generalized linear mixed model using glmmPQL (MASS library) to analyse my data i.e : y is the response with a poisson distribution, t and Trait are the independent variables which are continuous and categorical (3 categories C, M and F) respectively, ind is the random variable. mydata<-glmmPQL(y~t+Trait,random=~1|ind,family=poisson,data=tab) Do you think it
2006 Jul 25
1
Multiple tests on repeated measurements
...1, 1), nrow = 2, ncol=4, byrow=TRUE, dimnames = list(c("diff/v=0", "diff/v=1"), c("C.1", "C.2", "C.3", "C.4"))) v4 <- csimint(estpar=par4, df=n-6, # I'm not sure whether I found # the correct degrees of freedom covm=cov4, cmatrix=cm4, conf.level=0.95) sv4 <- summary(v4) # 2. Method: I found in Handbook of Statistics Vol 13, p.616, # same can be found in http://home.clara.net/sisa/bonhlp.htm # Bonferroni on correlated outcomes: raw.p <- sv4$p.value.raw co4 <- cor(df$y[df$v==0],df$y[df$v==1]) rho <- mean(c(1,co4...
2004 Feb 20
1
nlme and multiple comparisons
This is only partly a question about R, as I am not quite sure about the underlying statistical theory either. I have fitted a non-linear mixed-effects model with nlme. In the fixed part of the model I have a factor with three levels as explanatory variable. I would like to use Tukey HSD or a similar test to test for differences between these three levels. I have two grouping factors:
2003 May 05
1
multcomp and lme
I suppose that multcomp in R and multicomp in S-Plus are related and it appears that it is possible to use multicomp with lme in S-Plus given the following correspondence on s-news sally.rodriguez at philips.com 12:57 p.m. 24/04/03 -0400 7 [S] LME summary and multicomp.default() Is it possible to use multicomp with lme in R and if so what is the syntax from a simple readily available
2003 May 08
0
multcomp and lme (followup)
...- mginv(contrMat(table(group), type="Will")) # a binary response z <- factor(rbinom(30, 1, 0.5)) # estimate the model gmod <- glm( z ~ group, family=binomial(link = "logit")) # exclude the intercept summary(csimtest(coef(gmod)[2:3], vcov(gmod)[2:3,2:3], cmatrix=diag(2), df=27, asympt=TRUE)) > Thank you very much. > > Peter B. _______________________________________________________________________ | | | Dipl.-Stat. Torsten Hothorn | | Institut fuer Medizininformatik, Biometrie und Epidemiologie | | Waldstrasse 6, D-91054 Erlangen...
2017 Oct 21
1
What exactly is an dgCMatrix-class. There are so many attributes.
...I don't feel >> alone. I don't find the documentation go into any detail. > >> I also find it surprising that, > >>> object.size(train$data) >> 1730904 bytes > >>> object.size(as.matrix(train$data)) >> 6575016 bytes > >> the dgCMatrix actually takes less memory, though it >> *looks* like the opposite. > > to whom? > > The whole idea of these sparse matrix classes in the 'Matrix' > package (and everywhere else in applied math, CS, ...) is that > 1. they need much less memory and > 2. matrix...
2010 Feb 18
3
R CMD check: OK in LINUX. Crashes in Windows!
Hi, I have followed the recommended steps for creating a package (rctest). As of now, my goal is simply to understand how various pieces fit together. The package includes: (1) C code with source in sub-directories, compiled to create a static library. (a) There is a single C-struct (dns) a simple 'matrix': {int m; int n; double *d;} (b) C code to create random matrix of a certain size.
2017 Oct 21
0
What exactly is an dgCMatrix-class. There are so many attributes.
...responses. I guess I don't feel > alone. I don't find the documentation go into any detail. > I also find it surprising that, >> object.size(train$data) > 1730904 bytes >> object.size(as.matrix(train$data)) > 6575016 bytes > the dgCMatrix actually takes less memory, though it > *looks* like the opposite. to whom? The whole idea of these sparse matrix classes in the 'Matrix' package (and everywhere else in applied math, CS, ...) is that 1. they need much less memory and 2. matrix arithmetic with them can be much f...
2017 Oct 20
4
What exactly is an dgCMatrix-class. There are so many attributes.
Thank you for your responses. I guess I don't feel alone. I don't find the documentation go into any detail. I also find it surprising that, > object.size(train$data) 1730904 bytes > object.size(as.matrix(train$data)) 6575016 bytes the dgCMatrix actually takes less memory, though it *looks* like the opposite. Cheers! On Fri, Oct 20, 2017 at 3:22 PM, David Winsemius <dwinsemius at comcast.net> wrote: > > > On Oct 20, 2017, at 11:11 AM, C W <tmrsg11 at gmail.com> wrote: > > > > Dear R list, > > >...