search for: x1x2

Displaying 13 results from an estimated 13 matches for "x1x2".

Did you mean: x12
2002 May 17
0
options()$warn==2 and try()
...t;,survname="fail tm12", censname="failcens") Warning message: Loglik converged before variable 2 ; beta may be infinite. in: fitter(X, Y, strats, offset, init, control, weights = weights, > ## warnings are just warnings when options()$warn=0: > lapply(qq,class) $cph.x1x2 [1] "coxph" $cph.x1x2.int [1] "coxph" > qq <- FitModels(vnames=c("cd3ncd56p","adrpcd8p"),dframe="ALLmth12",survname="failt m12", censname="failcens") Warning message: Loglik converged before variable 1 ; beta may be infi...
2011 Nov 17
1
Vectorizing for weighted distance
...ll, I am trying to convert the following piece of matlab code to R: XX1 = sum(w(:,ones(1,N1)).*X1.*X1,1); #square the elements of X1, weight it and repeat this vector N1 times XX2 = sum(w(:,ones(1,N2)).*X2.*X2,1); #square the elements of X2, weigh and repeat this vector N2 times X1X2 = (w(:,ones(1,N1)).*X1)'*X2; #get the weighted 'covariance' term XX1T = XX1'; #transpose z = XX1T(:,ones(1,N2)) + XX2(ones(1,N1),:) - 2*X1X2; #get the squared weighted distance which is basically doing: z=(X1-X...
2004 Apr 05
0
Selecting Best Regression Equation : leaps() in R and stepwise() in S+
...are- -------------------------------------- > options(prompt=" R > " ) R > leafbrn1<-read.table("c:\\leafbrn.txt",header=T) R > leafbrn.data1<-data.frame(leafbrn1) R > attach(leafbrn.data1) R > x1sq<-x1^2;x2sq<-x2^2;x3sq<-x3^2;x1x2<-x1*x2;x1x3<-x1*x3;x2x3<-x2*x3; R > leafbrn <- cbind(leafbrn1,x1sq,x2sq,x3sq,x1x2,x1x3,x2x3) R > detach(leafbrn.data1) R > leafbrn.data<-data.frame(leafbrn) R > attach(leafbrn.data) R > X<-cbind(x1,x2,x3,x1sq,x2sq,x3sq,x1x2,x1x3,x2x3) R >...
2010 Mar 26
2
R loop help
Hi, I am tring to write a loop to compute this, ========================== x1=c( rep(-1,4), rep(1,4) ) x2=c( rep(c(-1,-1,1,1),2) ) x3=c( rep(c(-1,1),4) ) x1*x2 x1*x3 x2*x3 ======================== suppose i have x1,x2,x3 i want to compute their ' two factor interactions', x1x2,x1x3 and x2x3, I wrote ======================== for(i in 1:2){ for( j in i+1:3){ xij=c() xij=xi*xj } } ======================== it did not seem to recognize xi and xj is there any suggestion? it would be wonderful if there exists a single command that i can use My ultimate aim is to find the...
2006 Apr 23
2
distribution of the product of two correlated normal
Hi, Does anyone know what the distribution for the product of two correlated normal? Say I have X~N(a, \sigma1^2) and Y~N(b, \sigma2^2), and the \rou(X,Y) is not equal to 0, I want to know the pdf or cdf of XY. Thanks a lot in advance. yu [[alternative HTML version deleted]]
2012 Sep 12
3
how to create a substraction matrix (subtract a row of every column from the same row in other columns)
...y, each number represents a year, and I want each comparison to only be listed once, the difference between the 1st year the sample was taken and then 2nd year the sample was taken. (This would probably entail just taking a portion of the matrix.) . This is what the result would be difftype value x1x2 x1x3 x1x4 x1x5 x2x3 x2x4 x2x5 x3x4 x3x5 x4x5 Thank you for any help you can give me. -- View this message in context: http://r.789695.n4.nabble.com/how-to-create-a-substraction-matrix-subtract-a-row-of-every-column-from-the-same-row-in-other-column-tp4642949.html Sent from the R help ma...
2011 Apr 18
1
covariance matrix: a erro and simple mixed model question, but id not know answer sorry
Dear list I need your help: Execuse me for my limited R knowledge. #example data set set.seed (134) lm=c(1:4) block = c(rep(lm,6)) gen <- c(rep(1, 4), rep(2, 4), rep(3, 4), rep(4, 4),rep(5, 4),rep(6, 4)) X1 = c( rnorm (4, 10, 4), rnorm (4, 12, 6), rnorm (4, 10, 7),rnorm (4, 5, 2), rnorm (4, 8, 4), rnorm (4,7, 2)) X2 = X1 + rnorm(length(X1), 0,3) yvar <- c(X1, X2) X <- c(rep( 1,
2010 Jul 23
2
randomness using runif
...R console, the function runif gets "reset" to some initial value. For example... In a NEW R console, enter the following: x1 <- runif(1000, -1, 1) x2 <- runif(1000, -1, 1) x1[1:5] x2[1:5] objectsToSave <- c("x1", "x2") filename <- "C:\\Documents\\x1x2file.Rdata" save(list=objectsToSave, file=filename, envir = parent.frame()) Then in a different NEW R console, enter this: x3 <- runif(1000, -1, 1) x4 <- runif(1000, -1, 1) x3[1:5] x4[1:5] # For me, the values look identical to x1 and x2, but let's check by loading the x1x2 file...
2007 Mar 05
4
about find the solution
If I want to find out the soltion of X1,X2 that min(3X1+2X2+X1X2) subject to 20<=X1+3X2<=50 10<=X1 which function or package can I use? Thanks.
2008 Aug 03
0
missing F statistic in anova.gam
...) 1 3822.000 33970 2 3819.535 33921 2.465 49 2.2257 0.09578 . --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > anova(EqQuad,EqGamAS,test="F") Analysis of Deviance Table Model 1: y2 ~ x1 + x1sq + x2 + x2sq + x1x2 + X Model 2: y2 ~ s(x1) + s(x2) + X Resid. Df Resid. Dev Df Deviance F Pr(>F) 1 3819.00000 33955 2 3819.53502 33921 -0.53502 34 Model 1: y2 ~ s(x1) + s(x2) + X Model 2: y2 ~ X + s(x1, x2) Resid. Df Resid. Dev Df Deviance...
2009 Jan 12
3
polychoric correlation: issue with coefficient sign
Hello, I am running polychoric correlations on a dataset composed of 12 ordinal and binary variables (N =384), using the polycor package. One of the association (between 2 dichotomous variables) is very high using the 2-step estimate (0.933 when polychoric run only between the two variables; but 0.801 when polychoric run on the 12 variables). The same correlation run with ML estimate returns a
2010 Aug 24
1
Time and space considerations in using predict.glm.
Hello, I am using R to train a logistic regression model and save the resulting model to disk. I am then subsequently reloading these saved objects, and using predict.glm on them in order to make predictions about single-row data frames that are generated in real-time from requests arriving at an HTTP server. The following code demonstrates the sort of R calls that I have in mind: > cases
2008 Aug 05
0
P values in non linear regression and singular gradients using nls
...) 1 3822.000 33970 2 3819.535 33921 2.465 49 2.2257 0.09578 . --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 > anova(EqQuad,EqGamAS,test="F") Analysis of Deviance Table Model 1: y2 ~ x1 + x1sq + x2 + x2sq + x1x2 + X Model 2: y2 ~ s(x1) + s(x2) + X Resid. Df Resid. Dev Df Deviance F Pr(>F) 1 3819.00000 33955 2 3819.53502 33921 -0.53502 34 Model 1: y2 ~ s(x1) + s(x2) + X Model 2: y2 ~ X + s(x1, x2) Resid. Df Resid. Dev Df Deviance...