similar to: Creating quintiles on monthly basis

Displaying 20 results from an estimated 600 matches similar to: "Creating quintiles on monthly basis"

2012 Apr 20
1
Package "demography" - calculating quintiles of survival probabilities
Hi, I am using the package "demography" from Rob Hyndman for the Lee-Carter-Model. It is an amazing powerful tool but I am struggling with one issue: *I want to compute different quintiles for the cumulative survival probability derived from the Lee-Carter-Forecast (e.g. the 50%-quintile, 75%-quintile and 99%-quintile) for the next 10 years. * I am sure the package possess this
2009 Jan 19
1
conditional weighted quintiles
Dear All, I am economist and working on poverty / income inequality. I need descriptive statitics like the ratio of education expentitures between different income quintiles where each household has a different weight. After a bit of google search I found 'Hmisc' and 'quantreg' libraries for weighted quantiles. The problem is that these packages give me only weighted quintiles;
2011 May 08
2
help with mysql and R: partitioning by quintile
Hi, I have a mysql table with fields userid,track,frequency e.g u1,1,10 u1,2,100 u1,3,110 u1,4,200 u1,5,120 u1,6,130 . u2,1,23 . . where "frequency" is the number of times a music track is played by a "userid" I need to turn my 'frequency' table into a rating table (it's for a recommender system). So, for each user, I need to categorise the frequency of tracks
2015 Aug 02
3
ayuda con análisis de supervivencia
Hola a todos, -Estoy estudiando el efecto de dos genotipos (~tratamientos) en la aparición de síndrome metabólico (MetS) con datos longitudinales recogidos a tiempo 0,7,10,15,20 y 25 años. -He hecho un dataframe con las siguientes variables MetS: Síndrome Metabólico (Si=1,No=0) bmi: Indice de masa corporal (IMC) cuando se produce la conversión a MetS+ . Para los que permancen MetS-, esta variable
2011 Nov 18
1
R: writing data from one matrix into another with keeping NA's
Hi, I am looking to build even quintiles for a set of data. I managed to get it done, but I would like to know if there is a more direct way to write the data from my loop output x in the bottom of the code into the "empty" matrix p1, which I filled with NA''s. The way I am doing it at the moment is, more or less adding the matrix x after p1 and then deleting in a second step
2011 Mar 24
5
subset and as.POSIXct / as.POSIXlt oddness
Dear R users, Given this data: x <- seq(1,100,1) dx <- as.POSIXct(x*900, origin="2007-06-01 00:00:00") dfx <- data.frame(dx) Now to play around for example: subset(dfx, dx > as.POSIXct("2007-06-01 16:00:00")) Ok. Now for some reason I want to extract the datapoints between hours 10:00:00 and 14:00:00, so I thought well: subset(dfx, dx >
2011 Aug 31
2
reshape/aggregate
Hi all, I apologize for this probably stupid question, but I really can't figure it out. I have a dataframe like this: group <- c(rep('A', 8), rep('B', 15), rep('C', 6)) time <- c(rep(seq(1:4), 2), rep(seq(1:5), 3), rep(seq(1:3), 2)) value <- runif (29, 1, 10) dfx <- data.frame (group, time, value) I want to calculate mean and standard deviation for all
2004 Nov 10
1
lattice: ordering the entries in a dotplot of a vector
I tried: n <- 9 x <- sample(n) names(x) <- LETTERS[1:n] dotplot( sort(x) ) The lines of the dotplot are not ordered according to the values of x (but according to the names of x). So I did: dfx <- data.frame( x=x, label=factor( names(x), names(x)[order(x)] ) ) dotplot( label ~ x, data=dfx ) So I got what I wanted. My question: Is there an easier solution
2004 Oct 20
1
Drawing multiple line plots
Hi All: Greetings, and best wishes from the festive times here at Kolkata, India -- the time of Durga Puja celebrations. I seek your advice as I try plotting lines for my data. The problem: I have created a dataframe that looks like this (name: myFrame): lowest second third fourth highest significance INAS 0.107 0.115 0.123 0.115 0.166 0.000 MMA 0.091 0.107 0.115
2007 Oct 02
4
Strange names when creating a data.frame: Difference between <- and =
This is just a curiosity question. Why do the two different syntaxes for df1 and df2 give such different results in the names(dfx)? Thanks df1 <- data.frame(nas = c("A", "B" , "B" ,"C" ,"B", "A", "D"),nums = c(3, 2, 1, 1, 2, 3, 7)) df2 <- data.frame(nas <- c("A", "B" ,
2010 Apr 07
0
Help with manipulation of svytotal output
I have some output from a survey shown below and would like to insert total rows for each category to then be able to use it as a data set for further analysis. Is it possible to do this in R. In this example I would like to insert a row between rows 5 and 6, 10 and 11, 15 and 16, 20 and 21 and put in the sum of the rows 1-5, 6-10, 11-15, 16-20 and to delete row 21 which has NA in it. I would
2007 Mar 12
1
replicating SAS's "proc rank" procedure
Hello- I wonder if there's a way to replicate SAS rank procedure where it ranks a variable by a certain number of groups. For example, it's very easy to calculate quintile rank in SAS, but I couldn't find the similar function in R. Does anyone know how to do this? Thanks. -- View this message in context:
2013 Mar 26
2
GAM model with interactions between continuous variables and factors
Hi all, I am not sure how to handle interactions with categorical predictors in the GAM models. For example what is the different between these bellow two models. Tests are indicating that they are different but their predictions are essentially the same. Thanks a bunch, > gam.1 <- gam(mortality.under.2~ maternal_age_c+ I(maternal_age_c^2)+ + s(birth_year,by=wealth) + +
2005 Sep 21
3
Sort a data frame with respect to more than one variable
Dear All, How can I sort a data frame with respect to more than one variable? I know that for one variable X one may use: df[order(df$X), ] where df is the data frame containing X. Many thanks, Bernard --------------------------------- [[alternative HTML version deleted]]
2010 Sep 07
2
Plotting longitudinal data
Hello, Hope that someone could help me plotting longitudinal data below: 7213 3333330001 0.8300 13.05.09 1 1 3333330001 0.8700 09.02.05 NULL 4797 3333330001 0.7700 21.03.07 NULL 2399 3333330001 0.7800 12.04.06 NULL 2400 3333330002 NULL 27.03.06 NULL 7230 3333330002 0.8200 14.05.09 0 2 3333330002 0.8400 09.02.05 NULL 4798 3333330002 0.8700 20.03.07 0 4799 3333330003 0.9000 20.03.07 13 2401
2005 Aug 16
2
problem using model.frame()
Hi I'm having a problem with model.frame, encapsulated in this example: y1 <- matrix(c(3,1,0,1,0,1,1,0,0,0,1,0,0,0,1,1,0,1,1,1), nrow = 5, byrow = TRUE) y1 <- as.data.frame(y1) rownames(y1) <- paste("site", 1:5, sep = "") colnames(y1) <- paste("spp", 1:4, sep = "") y1 model.frame(~ y1) Error in model.frame(formula, rownames,
2020 Nov 12
1
Propensity Score Matching
Hola chic en s, alguien con experiencia en propensión score matching? Planteo duda: Clasicamente el PSM se ha utilizado en un intento de homogeneizar cohortes de enfermos quienes han estado ?expuestos? a un tratamiento x Vs aquellos que no han estado expuestos (no expuestos). Esto aplica para medicamentos o procedimientos quirúrgicos o no. Bien, En algún articulo he leído que el PSM se puede
2012 May 10
0
Coloring subsets of points of a strip chart by quantiles
Hello All, I am trying to color five subsets of points in a series of vertical strip charts by quintiles using the quantile function, but I have not been able to do this successfully, nor have I been able to find an example of this online. I would like to have the "E1", "E2", and "E3" columns plotted on a single plot (containing the three strip charts). I am
2008 Feb 27
1
Calculating monthly var-cov matrix on non-overlapping rooling window basis
let create a 'zoo' object : library(zoo) date.data = seq(as.Date("01/01/01", format = "%m/%d/%y"), as.Date("06/25/02", format = "%m/%d/%y"), by = 1) len = length(date.data) data1 = zoo(matrix(rnorm(2*len), nrow = len), date.data ) head(data1) Now I want to create an 3 dimensional array (suppose name " var.cov") where,
2008 Aug 02
1
problem with nested loop for regression
Hi everyone, I'm experiencing difficulty getting the results I want when I use a nested for loop. I have a data set to which I perform some calculations, and then try to apply a regression over a rolling window. The code runs, but the regression results I am getting (intercept and slope) are simply the same, repeated again and again in the results matrix. The regression does not seem to be