similar to: vector decreasing by a factor

Displaying 20 results from an estimated 10000 matches similar to: "vector decreasing by a factor"

2011 Sep 04
2
Regression coefficient constraints
Hi Guys, Does anyone know how I could constrain my regression coefficients so that they are positive and add up to one? Any help will be greatly appreciated. Kind Regards, Andre [[alternative HTML version deleted]]
2010 Sep 11
5
for loop
Hello, I have a simple question: I want to list numbers 1:k, but if k <1, I hope nothing listed. how should we do? k=2 for (i in 1:k)  print(i) [1] 1    # <-correct [1] 2 k=0 for (i in 1:k) print(i) [1] 1      #<---- wrong [1] 0   thanks jian [[alternative HTML version deleted]]
2010 Sep 10
2
survfit question
Hi, I am attempting to graph a Kaplan Meier estimate for some claims using the survfit function. However, I was wondering if it is possible to plot a cdf of the kaplan meier rather than the survival function. Here is some of my code: library(survival) Surv(claimj,censorj==0) survfit(Surv(claimj,censorj==0)~1) surv.all<-survfit(Surv(claimj,censorj==0)~1) summary(surv.all) plot(surv.all)
2012 Jun 30
2
incorrect number of subscripts on matrix
Hi, Wondering if anyone could help me out with this error.Im trying to fill a matrix with random numbers taken from an exponential distribution using a loop: x.3<-matrix(rep(0,3000),nrow=1000,byrow=T)for(i in 1:1000){x[i,]<-rexp(3,rate=2/3)} I get the error message: Error in x[i, ] <- rexp(3, rate = 2/3) : incorrect number of subscripts on matrix Any ideas??? Appreciate any thoughts.
2011 May 06
2
for loop
Hi, I'm hoping someone can offer some advice:I have a matrix "x" of dimensions 160 by 10000. I need to create a matrix "y", where the first 7 elements are equal to x[1]^1/7, then the next 6 equal to x[2]^1/6, next seven x[3]^1/7 and so on all the way to the 10400000th element. I have implemented this with a for loop an hour ago and it is still loading, can anyone offer any
2010 Sep 26
1
acf function
Hi, Im new to R so this question is quite fundamental. Im trying to compare some autocorrelations generated by the acf function to some theoretical correlations. How can I have acces to just the autocorrelations, for computation? This is some of my code: > acf.data<-c(acf(x)) > acf.data This is the R output: $acf , , 1 [,1] [1,] 1.000000000 [2,]
2011 May 14
2
Survreg object
Hi,Just a quick one, does anyone know the command for accessing the standard errors from a survreg object? I can access the coefficients by model$coefficients, but I cant seem to find a command to access the errors. Any help would be greatly appreciated.Regards,Andre [[alternative HTML version deleted]]
2010 Dec 07
4
increase or decrease variable by 1
many languages have shorthands for that operation like: variable += 1 or ++variable is there something like that in R ? -- View this message in context: http://r.789695.n4.nabble.com/increase-or-decrease-variable-by-1-tp3076390p3076390.html Sent from the R help mailing list archive at Nabble.com.
2009 May 23
2
as.numeric(levels(factor(x))) may be a decreasing sequence
Function factor() in the current development version (2009-05-22) guarantees that levels are different character strings. However, they may represent the same decimal number. The following example is derived from a posting by Stavros Macrakis in thread "Match .3 in a sequence" in March nums <- 0.3 + 2e-16 * c(-2,-1,1,2) f <- factor(nums) levels(f) # [1]
2011 Aug 23
4
Correlation discrepancy
Dear R list, I have one very elementary question regrading correlation between two variables. x = c(44,46,46,47,45,43,45,44) y = c(44,43,41,41,46,48,44,43) > cov(x, y) [1] -2.428571 However, if I try to calculate the covariance using the formula as covariance = sum((x-mean(x))*(y-mean(y)))/8       # no of of paired obs. = 8 or     covariance = sum(x*y)/8-(mean(x)*mean(y)) gives
2013 Apr 25
2
Decomposing a List
Greetings! For some reason I am not managing to work out how to do this (in principle) simple task! As a result of applying strsplit() to a vector of character strings, I have a long list L (N elements), where each element is a vector of two character strings, like: L[1] = c("A1","B1") L[2] = c("A2","B2") L[3] = c("A3","B3")
2012 Jul 30
6
Turning off continuation prompt?
Greetings All. My apologies for a question whose answer is probably readily available somewhere (for some interpetation of "somewhere") ... Say I have just typed (from a sheet of paper) several lines into the R command-line, and what I see is: > chisq.test(matrix(c(3,6,3,4,4, + 4,1,4,6,5, + 2,7,4,2,5, + 8,2,4,4,2, +
2004 Jun 21
3
HTB patch - fairness
Witold Szczerba spent his time evaluating fairness of borrowing. His troubles inspired me enough to analyze the problem: When a class changes from yellow to green it disconnects itself from parent''s feedlist. Unfortunately it resets feed pointer to the first child. I created a patch where the class uses classid to remember its position in the feedlist. The patch for 2.4.24 and hopefully
2010 Mar 23
2
Decreasing Cumsum Function?
Hi all, I have a frequency data that looks like this. 3 2 1 5 What I want to get is the "decreasing" cumulative of this data yielding 11 8 6 5 0 Is there any? I am aware of cumsum(), which will yield 3 5 6 11. But it is not what I want. - G.V.
2010 Oct 06
2
ggplot2 barplot in decreasing frequency
Hi all, I have a large data frame and would like to make a barplot of a categorical variable with the bars sorted in order of decreasing frequency. # Example: v1 = c(1.2, 1.4, 0.9, 1.0, 1.1, 1.0) v2 = c("aa", "cc", "bb", "bb", "cc", "bb") v3 = c(8, 10, 11, 9, 9, 10) df = data.frame(v1=v1, v2=v2, v3=v3) # How can I tell ggplot to sort
2004 Apr 13
2
Non-homogeneity of variance - decreasing variance
Hello all, I'm running very simple regression but face a problem of non-homogeneity of variance, but with a decreasing variance with increasing mean...I do not know how to deal with that. this relationship doesn't seem to be strong, but it's my first time to see something like that, and would like to know what to do if one day it becomes stronger. I tested just for fun some
2005 Jun 25
2
optimization problem in R ... can this be done?
Im trying to ascertain whether or not the facilities of R are sufficient for solving an optimization problem I've come accross. Because of my limited experience with R, I would greatly appreciate some feedback from more frequent users. The problem can be delineated as such: A utility function, we shall call g is a function of x, n ... g(x,n). g has the properties: n > 0, x lies on the
2013 Nov 17
1
order() function, decreasing=TRUE unexpected behaviour
There appears to be an issue with the decreasing=TRUE option on the order() function that indicates either a bug or perhaps a design flaw (potentially flawed because I would suggest the majority of users would expect different behaviour). # demonstration of problem: x <- c(2,1,3,4,5) order(x) order(x, decreasing=TRUE) order(x) correctly reports the order as: 2 1 3 4 5 I expected the result
2007 Aug 06
1
rank in decreasing order
Hi All, I want to give ranks to elements in a column so I used: total_list$field1.rank <- rank(total_list$field1,ties.method="min") But this gives me the rank in increasing order. How do I get the ranks in decreasing order? I know decreasing = FALSE is not a legal argument here. Thanks. Jiong The email message (and any attachments) is for the sole use of the intended recipient(s)
2011 Apr 23
1
R_qsort decreasing =T
Hello, i'm using <R.h> & <Rmath.h>. What is the c equivalent to sort(x,deceasing=T) i.e. to get sort(x) i type R_qsort(x, 1, n), where do i set the decreasing=T flag ? More generally, is there a place where the functions in the R sources are documented ? Best, -- View this message in context: http://r.789695.n4.nabble.com/R-qsort-decreasing-T-tp3470432p3470432.html