search for: z1

Displaying 20 results from an estimated 543 matches for "z1".

2006 Jul 08
2
String mathematical function to R-function
...this string into function ( R function ). thanks for any tips. cleber #e.g. fun_String = "-100*x1 + 0*x2 + 100*x3" fun <- function(x1,x2,x3){ return( ############ evaluation( fun_String ) ############ ) True String mathematical function :-( :-( > nomes [1] "8.49*x1*z1 + 6.13*x1*z2 + 6.4*x1*z3 + 6.9*x2*z1 + 4.54*x2*z2 + 3.99*x2*z3 + 19.31*x3*z1 + 12.49*x3*z2 + 3.86*x3*z3 + 5.25*x1*z1*z2 + -6.2*x1*z1*z3 + 9.07*x1*z2*z3 + 10.87*x2*z1*z2 + 9.78*x2*z1*z3 + 49.05*x2*z2*z3 + 4.56*x1*x2*z1 + -4.9*x1*x2*z2 + 4.01*x1*x2*z3 + -0.39*x3*z1*z2 + 14.34*x3*z1*z3 + 0.7*x3*z2*z3...
2009 Nov 09
3
How to transform the Matrix into the way I want it ???
Hi, R users, I'm trying to transform a matrix A into B (see below). Anyone knows how to do it in R? Thanks. Matrix A (zone to zone travel time) zone z1 z2 z3 z1 0 2.9 4.3 z2 2.9 0 2.5 z3 4.3 2.5 0 B: from to time z1 z1 0 z1 z2 2.9 z1 z3 4.3 z2 z1 2.9 z2 z2 0 z2 z3 2.5 z3 z1 4.3 z3 z2 2.5 z3 z3 0 The real matrix I have is much larger, with more than 2000 zones. But I think it should be the same thing if I can transform A into B. Thanks. Gar...
2003 Apr 04
3
trellis.graphic in for-loop
...;fontsize fontsize$default<-16 trellis.par.set("fontsize",fontsize) a<-c(1,2,4,5,4,3,3,3) b<-c(2,5,1,1,1,3,3,3) c<-c(3,5,1,2,2,5,5,5) as.data.frame(cbind(a,b,c))->q21 varnames<-colnames(q21) i<-9999 for (i in 1:3) { round(table(q21[,i])/sum(table(q21[,i])),3)*100->z1 as.data.frame.table(table(q21[,i]))->z1 round(z1[,2]/sum(z1[,2]),3)*100->z1[,2] colnames(z1)<-c(varnames[i],"y") xnames<-levels(z1[,1]) paste(xnames[1]," - low",sep="")->xnames[1] paste(xnames[length(xnames)]," - high",sep=&qu...
2012 Sep 23
2
If Command in Plot
...attice_0.20-6 foreign_0.8-50 [9] rgdal_0.7-18 sp_0.9-99 loaded via a namespace (and not attached): [1] RCurl_1.91-1 grid_2.15.1 tools_2.15.1 twitteR_0.99.19 It's very simple but I am not able to plot it with following commands for (i in 1:9) {ifelse(z1$e[[i]] > 0 , plot(z1$x,z1$y),plot(z1$x,z1$e))} Or ifelse(z1$e > 0,plot(z1$x,z1$y),plot(z1$x,z1$e)) Bhupendrasinh Thakre [[alternative HTML version deleted]]
2009 Feb 12
2
repost: problems with lm for nested fixed-factor Anova (ANOVA I)
...not a single suggestion. I believe I have provided sufficient information for at least some help. Here I repost the question with several modifications. I want to run nested fixed-factor Anova in R on different experiments. I have 48 levels of the main factor x1 and 242 levels of the nested factor z1, and continuous response variable y1 with around 15.000 data points. There is no interaction between specification of the main factor and nested factor levels. When I run lm on using nested design anov1=lm(c(as.vector(y1))~as.factor(x1)+ as.factor(x1)/as.factor(z1)) I get a warning summary(anov...
2020 Jun 10
2
kinit with SPN fail
Hello again, after obtaining the keytab file I tried to use kinit keytab.file followed by the spn $ samba-tool spn list z1 z1 User CN=z1,CN=Users,DC=home,DC=lan has the following servicePrincipalName: zookeeper/ap42.home.lan $ samba-tool domain exportkeytab z1.ktab --principal=z1 $ samba-tool domain exportkeytab z1.ktab --principal=zookeeper/ap42.home.lan $ kinit -V -k -t z1.ktab zookeeper/ap42.home.lan Usin...
2006 Aug 30
4
Barplot
...tive 6 0 1 0 0 1 1 1 1 Negative 7 1 0 1 1 1 1 1 1 Negative 8 0 0 0 0 1 0 0 1 Negative 9 0 1 1 1 1 0 0 1 Negative 10 0 0 0 1 1 0 1 0 Positive 11 0 0 0 0 1 0 0 1 Negative 12 0 0 1 1 1 1 1 0 Positive 13 0 1 1 0 1 1 1 1 Negative" z1 <- read.table(textConnection(Zero1), header=TRUE) z1 str(z1) A simple way I can use mosaic plot mosaicplot(table(z1)) library(vcd) mosaic(table(z1)) I have tried to learn ?xtabs ?table and ?ftable but I can't figure out. I need a barplot for all variables and the result maybe like | |...
2012 Aug 08
3
help, please! matrix operations inside 3 nested loops
..._excl_5_282_559.txt', header=TRUE, sep="\t") daten<-as.matrix(daten) #2) create empty matrix: indxind<-matrix(nrow=617, ncol=617) indxind[1:20,1:19] #3) compare cells to each other, score: for (s in 3:34) { #walks though the matrix colum by colum, starting at colum 3 for (z1 in 1:617) { #for each current colum, take one row (z1)... for (z2 in 1:617) { #...and compare it to another row (z2) of the current colum if (z1!=z2) {topf<-indxind[z1,z2] if (daten[2*z1-1,s]==daten[2*z2-1,s]) topf<-topf+1 #actually, 2 rows make up 1 individua...
2006 Jun 15
3
matrix selection return types
Dear Rusers, I would like some comments about the following results (under R-2.2.0) > m = matrix(1:6 , 2 , 3) > m [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 > z1 = m[(m[,1]==2),] > z1 [1] 2 4 6 > is.matrix(z1) [1] FALSE > z2 = m[(m[,1]==0),] > z2 [,1] [,2] [,3] > is.matrix(z2) [1] TRUE Considered together, I'm a bit surprised about the returned types from z1 and z2. I would not have been surprised if z1 would still have been...
2011 Mar 29
5
Integration with variable bounds
...posted elsewhere I cannot find it. I need to perform multiple integration where some of the variables are in the bounds of the other variables. I was trying to use R2Cuba function but cannot set the upper and lower bounds. My code so far is : int <- function(y){ u2 = y[1] z2 = y[2] u1 =y[3] z1 = y[4] ff <- u1*(z1-u1)*u2*(z2-u2)*exp(-0.027*(12-z2)) return(ff) } cuhre(4,1,int,rel.tol=1e-3,lower=c(y[4],y[4],4,4),upper=c(12,y[4],12,y[2]),abs.tol= 1e-12,flags= list(verbose=2, final=0)) I know that code is wrong but it shows that variables are in both the upper and lower bounds. Thanks...
2009 Nov 24
1
Titles in plots overlap
...  I use fCopulae package to draw different graphs of univariate and bivariate skew t.  But the plots titles overlap.  I tried using cex.main, font.main to adjust the size but they still overlaps.  Here is my code: par(mfrow = c(3, 1)) mu = 0 Omega = 1 alpha1 = 0 alpha2 = 1.5 alpha3 = 2 alpha4 = 0.5 Z1 = matrix(dmvst(x, 1, mu, Omega, alpha1, df = Inf), length(x)) Z2 = matrix(dmvst(x, 1, mu, Omega, alpha2, df = 5), length(x)) Z3 = matrix(dmvst(x, 1, mu, Omega, alpha3, df = 5), length(x)) Z4 = matrix(dmvst(x, 1, mu, Omega, alpha4, df = Inf), length(x)) plot(x,Z1, ylim=range(Z1,Z2), type='l'...
2002 Mar 27
2
Error with nls
...6, p60, p65, pc, ph, pd, pb50, pb60) { k50 <- exp(p50) k56 <- exp(p56) k60 <- exp(p60) k65 <- exp(p65) c <- exp(pc) h <- exp(ph) d <- exp(pd) b50 <- exp(pb50) b60 <- exp(pb60) a <- (k50+k56) b <- k65 e <- k56 f <- (k60+k65) z1 <- (-(a+f)/2 - sqrt((a+f)^2/4 - a*f + b*e)) z2 <- (-(a+f)/2 + sqrt((a+f)^2/4 - a*f + b*e)) K <- ((z1+a)/(z2-z1)) B1 <- (b/(z2-z1)*b60 - K*b50) A1 <- (b50-B1) X1 <- (b*d/(z2-z1)-K*(c*b4i+h)) X2 <- (K*c*(b4i-b40)) X3 <- (c*b4i + h - X1) X4 <- (c*(b40-b4i)-...
2009 Feb 09
0
problems with lm for nested fixed-factor Anova
Dear R users, I want to run nested fixed-factor Anova in R on different experiments. In this toy example I have 3 levels of the main factor x1 and 7 levels of the nested factor z1 x1 and continuous response variable y1. x1 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 [38] 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 [75] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 z1 [1] 1 1 1 1 1 1 1 1 1 1 1...
2013 Oct 19
3
bold dot size and name in plot
Dear useRs, I have the following data "z" of two variables "x"(z[,1]) and "y"(z[,2]). > dput(z) structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
2004 Feb 27
4
question
Hi everybody. The question: I get two vectors 'iFalseFalse' and 'i2'. I think they should be the same but they are not. Is it because R does not handle complicated logical expressions in such cases or I do something wrong? > z1 = c(NA, "", 3, NA, "", 3) > z2 = c("", "", 3, NA, 3, NA) > cV = (as.character(z1)==as.character(z2)) > cV [1] NA TRUE TRUE NA FALSE NA > > iFalse = (c(1:(length(z1))))[(cV==FALSE)] > iNonNA = (c(1:(length(z1))))[(!(is.na(cV)))] &g...
2017 Jul 28
3
problem with "unique" function
I have the joint distribution of three discrete random variables z1, z2 and z3 which is captured by "z" and "prob" as described below. For example, the probability for z1=0.46667, z2=-1 and z3=-1 is 2.752e-13. Also, the probability adds up to 1. > head(z) z1 z2 z3 [1,] -0.46667 -1.0000 -1.0000 [2,] -0.33333 -0.9333 -0.93...
2010 Feb 09
1
how to adjust the output
...<- 2.0165   rho  <- 0.868   # simplified expressions   a      <- alp-0.5   c1     <- sqrt(pi)/(gamma(alp)*(1-rho)^alp)   c2     <- sqrt(rho)/(1-rho)   t1     <- exp(-z/(1-rho))   t2     <- (z/(2*c2))^a   bes1   <- besselI(z*c2,a)   t1bes1 <- t1*bes1    c1*t1bes1*t2 }   z1  <- 20 cdf <- integrate(integrand, lower = 0, upper = z1,abs.tol = FALSE) r   <- runif(1)   ## Newton iteration z2  <- z1 - (cdf - r)/integrand(z1)   Output   > z1  <- 20   > cdf <- integrate(integrand, lower = 0, upper = z1)   > r   <- runif(1)   > z2  <- z1 - (...
2012 Mar 16
1
multivariate regression and lm()
...s. However my tests (shown below) indicate that lm() actually seems to perform separate regressions for each of the response variables without accounting for their possible correlation. ### multivariate analysis using lm() ### ######################################## > ex7.8 <- data.frame(z1 = c(0, 1, 2, 3, 4), y1 = c(1, 4, 3, 8, 9), y2 = c(-1, -1, 2, 3, 2)) > > f.mlm <- lm(cbind(y1, y2) ~ z1, data = ex7.8) > summary(f.mlm) Response y1 : Call: lm(formula = y1 ~ z1, data = ex7.8) Residuals: 1 2 3 4 5 0 1 -2 1 0 Coefficients: Estimate Std. Error t valu...
2008 Jul 11
1
Comparing complex numbers
Is there an easy way to compare complex numbers? Here is a small example: > (z1=polyroot(c(1,-.4,-.45))) [1] 1.111111-0i -2.000000+0i > (z2=polyroot(c(1,1,.25))) [1] -2+0i -2+0i > x=0 > if(any(identical(z1,z2))) x=99 > x [1] 0 # real and imaginary parts: > Re(z1); Im(z1) [1] 1.111111 -2.000000 [1] -8.4968e-21 8.4968e-21 > Re(z2); Im...
2008 Oct 04
3
How to plot countours with fixted densities?
...ormal dependence structure with unit Frechet margins. Sigma <- matrix(c(1,.5*sqrt(1),.5*sqrt(1),1),2,2) # generate y <- mvrnorm(Nsam, c(0,0), Sigma) # random v <- cbind(pnorm(y[,1],mean = 0, sd = 1), pnorm(y[,2],mean = 0, sd = 1)) z <- cbind(-1/log(v[,1]),-1/log(v[,2])) z1 <- z[,1] z2 <- z[,2] And to get the scatter plot by: plot(z1,z2) How can I get the contour densities plots for (z1,z2) at 10^(-j/2) for j=2,...,9? Waiting for your reply!Many thanks! Xiao [[alternative HTML version deleted]]