similar to: Deciles and R

Displaying 20 results from an estimated 1000 matches similar to: "Deciles and R"

2010 May 06
1
How to rank matrix data by deciles?
Hi R users, I have a matrix of data similar to: > y=matrix(rnorm(55),ncol=5) I would like to know to which decile each number belongs compared to the numbers in its column. Say y[1,1] is the third decile among y[1:11,1] and y[2,1] is in the second decile I would like get a matrix that would return their ranks in decile, i.e., y[1,1] -> 3 y[2,1] -> 2 Your help is much appreciated!
2006 May 09
2
devide data into decile
I guess this is really basic. But I do not find an answer yet. I have a big data.frame. I would like to divede them into 10 deciles accounding to one of its member. Then I need a number for each decile with some computaion within each group. How to devide it?
2006 Nov 16
1
getting a title in a plot during an lapply
In my code below tempa and tempb are numeric vectors that I combined into a dataframe along with the deciles of tempa. I have an lapply statement that goes through the dataframe and does ten plots according to the appropriate decile. The code is below and it works fine. There are no bugs so I figure there was no need to include structure statements on the data. Also, I don't want to use coplot
2004 Aug 03
1
Data manipulation query
Hi, Not sure if I am making a simple problem complex but still here we go: I have a data frame with four columns say, X1 X2 X3 and X4. I want to break X4 into deciles and for each deciles obtained, I want to see corresponding elements of X1. Ideally, the output should be in a tabular fashion as shown below: Deciles 1 Deciles 2 .... Deciles 10 X1-1 X1-2 X1-99 X1-5 X1-3 X1-10
2007 Jul 10
1
exces return by mktcap decile for each year
I have a data frame, lets call it dat, with 3 columns ( mc, yr, ret) which represent market cap, year, and return. mc is a factor, mc, and ret are real numbers. I want to add a column to the data calculated as follows. For each year, I want to split the data by mc decile, then calculate the mean ret within that mc decile, and finally subtract that year's decile mean from the raw return. Then
2012 Nov 22
1
Efficiently creating/defining new variables transformations
I would like to add an extension to the current name of a variable to create a new variable that is its sqrt transform. Each piece of the equation below works independently, but the left side definition fails on run. I also tried creating the variable name first, but ended up with an object that toString() did not fix. Better ideas? Example 1
2007 Feb 01
2
Losing factor levels when moving variables from one context to another
Hi, there I'm currently trying to figure out how to keep my "factor" levels for a variable when moving it from one data frame or matrix to another. Example below: vec1<-(rep("10",5)) vec2<-(rep("30",5)) vec3<-(rep("80",5)) vecs<-c(vec1, vec2, vec3) resp<-rnorm(2,15) dat<-as.data.frame(cbind(resp, vecs))
2011 Nov 04
1
Decision tree model using rpart ( classification
Hi Experts, I am new to R, using decision tree model for getting segmentation rules. A) Using behavioural data (attributes defining customer behaviour, ( example balances, number of accounts etc.) 1. Clustering: Cluster behavioural data to suitable number of clusters 2. Decision Tree: Using rpart classification tree for generating rules for segmentation using cluster number(cluster id) as target
2011 Jan 04
1
Go from CALLINGout to just CALLING
Hello list, how can I go from CALLINGout to just CALLING ? I've tried : exten => s,n,Set(newVAR=${CUT(CALLINGout,,3)}) or exten => s,n,Set(newVAR=$[CUT(CALLINGout,,3)]) But no result : [Jan 4 11:10:12] -- Executing [s at from-S:34] NoOp("SIP/s2-0000003b", "newVAR=") in new stack Asterisk 1.6.10 here. Kind regards, Jonas. -------------- next part
2010 Mar 08
1
Help with Hmisc, cut2, split and quantile
Hello, I have a set of data with two columns: "Target" and "Actual". A http://n4.nabble.com/file/n1584647/Sample_table.txt Sample_table.txt is attached but the data looks like this: Actual Target -0.125 0.016124906 0.135 0.120799865 ... ... ... ... I want to be able to break the data into tables based on quantiles in the "Target" column. I can see (using
2012 Jun 27
1
If statement - copying a factor variable to a new variable
I need to look through a dataset with two factor variables, and depending on certain criteria, create a new variable containing the data from one of those other variables. The problem is, R keeps making my new variable an integer and saving the data as a 1 or 2 (I believe the levels of the factor). I've tried using as.factor in the IF output statement, but that doesn't seem to work. Any
2003 Oct 13
1
AGI solution to Grandstream BT102 call waiting problem
I'm trying to fix a problem with the GrandStream Budgetone 102. I've been reading the source code, mailing lists and other resources. Here's the scenario and the approach I have been pursuing. I'm having some problems with the AGI calls and I hope someone can give me some clarification. PSTN <---> T1,PRI * <---> Grandstream BT 102 (12)
2006 May 24
5
Joining variables
Hello, If I have two variables that are factors or characters and I want to create a new variable that is the combination of both what function can I use to accomplish this? Ex. Var1 Var2 SA100055113 19851113 And I want NewVar SA10005511319851113 Thanks in advance. Cameron Guenther, Ph.D. Associate Research Scientist FWC/FWRI, Marine Fisheries Research 100 8th Avenue S.E. St.
2007 Oct 12
2
Plotting question
I am constructing plots ( regular not lattice ) and my initial command is par(mar=c(3,4,2,2), mfcol=c(5,2)) and then I create 10 plots on the page. It looks great but the plots on the page go in the order 1 6 2 7 3 8 4 9 5 10 Where the numbers denote decile breakdowns. Is there an easy way to make them go from left to right so 1 2 3 4 5 6 7 8 9 10 I could try
2009 Feb 27
1
Large 3d array manipulation
I have a large 3 dimensional array of size (243,246,768) The first dimension is Rows, second is columns and the third is Time. So for each row and column, I want to calculate the mean of time steps 1:8, 2:9, 3:10 and so on and assign the values to a new array. For this I am using the following script. for(i in 1:243) { for(j in 1:246) { for(k in 1:768) { newVar[i,j,k] <- mean(
2005 Aug 03
2
using weighted.mean with tapply()
I am trying to calculate the weighted mean for a of 10 deciles and I get an error: > decile <- tapply(X=mat$trt1m, INDEX=mat$Rank, FUN=weighted.mean, w=mat$mcap) Error in FUN(X[[1]], ...) : 'x' and 'w' must have the same length All three of my inputs have the same length, as shown below, and the weighted.mean calculation works by itself, just not in tapply() >
2005 Apr 14
1
Multiple copies of attached packages
I have noticed that after I ran a batch script multiple times I get multiple copies of a package's name when I call search(). Is this a problem? > search() [1] ".GlobalEnv" "DF" "DF" [4] "DF" "DF" "DF" multiple copies here ... [13] "DF" "DF"
2012 Mar 14
1
How to use ggplot to do the binned quantile plots(one type of scatter plot)?
How to use ggplot to do the binned quantile plots(one type of scatter plot)? Hi all, I have done scatter plot: plot(x, y). Now I wanted to do binned quantile plots... can ggplot2 help me? For example, we bin x data into 10 bins. For each bin, we draw the 10 deciles of the corresponding y data in that bin as points/dots. And then accross all bins, we would like to connect the corresponding
2008 Sep 26
1
Error in Cut command - 'x' must be numeric?
Hi Everyone I have a data set I want to bucket into deciles. Have been trying (without) success to use cut and using online help to understand my error. Here is my code to read in a few sample rows. I want to then create deciles by this variable > a<-read.csv("c:/temp/petrol.csv",header=TRUE,sep=",") > a tot_rdm_amt 1 40.15 2 332.65 3 533.37 4
2006 Mar 16
2
french secondary boxplot
bonjour, i'm a mathematic teacher and i have a question for R-developers : is it possible to have (in the future) a boxplot with whiskers from the first decile to the ninth decile, as usual in secondary french schools... by example : boxplot(serie,range=-1) for french boxplot ? cordialement, jean-pierre lyc?e jean zay orl?ans, france http://mathazay.free.fr/spip/