search for: quarters

Displaying 20 results from an estimated 736 matches for "quarters".

Did you mean: quarter
2008 Jan 23
3
How to do more advanced cross tabulation in R?
...) quarter=rep(1:4,each=4) sales=1:16 company=rep(c("a","b","c","d"),4) df=data.frame(year,quarter,sales,company) #this is the database I would like to construct a cross tabulation table like this: 2003 #a row of year(s) 1 2 3 4 #a row of quarters of each year a 1 2 3 4 b 5 6 7 8 c 9 10 11 12 c 13 14 15 16 #maybe add a row of subtotal for each quarter at the end. I tried xtabs, but all I could produce is this, unfortunately: xtabs(sales~year+quarter, data=df) quarter year 1 2 3 4 2003 10 26...
2008 Aug 19
0
Converting monthly data to quarterly dataMonday, August 18, 2008 11:38 AM
...f extra months at the beginning and the end of my data but your code is great for putting it then together quarterly. thanks again, Denise On Mon, 2008-08-18 at 14:31 +0100, Denise Xifara wrote: > Thank you very much Stephen, but how will aggregate deal with months that > fall outside annual quarters? eg, one extra month at the end of the dataset? [Without your data I'm kind of guessing at the exact format and problem, but the example below shows one way to deal with quarters that span years so should be adaptable to your problem. You also have a different idea of quarters to my ecological...
2012 Jul 24
9
Regular Expression
Hi-- I have three columns in an input file: MONTH QUARTER YEAR 2012-07 2012-3 2012 2001-07 2001-3 2001 2002-01 2002-1 2002 I want to make output like so: MONTH QUARTER YEAR 07 3 2012 07 3 2001 01 1 2002 I was having some trouble getting the regular expression to work. I think it should
2010 Feb 14
4
Newbie woes with *apply
Dataframe cust has Date-type column open.date. I wish to set up another column, with (first day of) the quarter of open.date. To be comprehensive (of course, improvement suggestions are welcome), month = function(date) { return(as.numeric(format(date,"%m"))) } first.day.of.month = function(date) { return(date + 1 - as.numeric(format(date,"%d"))) } first.day.of.quarter =
2006 Feb 17
3
(Newbie) Functions on vectors
Folks, I want to make the following function more efficient, by vectorizing it: getCriterionDecisionDate <- function (quarter , year) { if (length(quarter) != length(year)) stop ("Quarter and year vectors of unequal length!"); ret <- character(0); for (i in 1:length(quarter)) { currQuarter <- quarter[i]; currYear <- year[i]; if ((currQuarter < 1) |
2010 Jan 16
3
Comparing dates in dataframes
I have two data frames. One (arr) has all arrivals to an airport for a year, and the other (gw) has the dates and quarter hour of the day when the weather is good. arr has a Date and quarter hour column. >names(arr) [1] "Date" "weekday" "hour" "month" "minute" [6] "quarter" "ICAO"
2008 May 31
1
Representing 'Date' as 'Year - Quarter'
I have financial data on a a set of firms, with a quarterly period (fundamental data). The data spans 10 years, and four quarters per year. The present file (.csv) reads the Date columns as "200706" for the second quarter of 2007; "199809" for the third quarter of 1997. Is there a way I can convert it to something like "2007 Q2", "1998 Q3"? I am aware of the yearqtr feature of the zoo...
2010 Jan 18
3
Using the output of strsplit
I successfully combined my data frames, and am now on my next hurdle. I had combined the data and quarter, and used tapply to count the entries for each unique date/quarter pair. ar= tapply(ewrgnd$gw, list(ewrgnd$dq), sum) #for each date/quarter combination sums the gw (which are all 1) dq=row.names(ar) spl=strsplit(dq) But I need to split them back into the separate date and quarter. So I used
2009 Aug 13
3
Finding minimum of time subset
Dear List, I have a data frame of data taken every few seconds. I would like to subset the data to retain only the data taken on the quarter hour, and as close to the quarter hour as possible. So far I have figured out how to subset the data to the quarter hour, but not how to keep only the minimum time for each quarter hour. For example:
2009 Feb 19
2
table with 3 variables
I have the initial matrice: > *data.frame(Subject=rep(100:101, each=4), Quarter=rep(paste("Q",1:4, sep=""),2), Boolean = rep(c("Y","N"),4))* Subject Quarter Boolean 1 100 Q1 Y 2 100 Q2 N 3 100 Q3 Y 4 100 Q4 N 5 101 Q1 Y 6 101 Q2 N 7 101 Q3 Y 8 101
2004 Jul 26
1
group definition for a bootstrap
Hi, This is probably really simple, but I am clearly not R-minded, I have read the help files, and reread them, and I still can't work out what to do... I have a data frame (d) with 3 columns (age (0-5), quarter (1-4) and x). I want to estimate the precision of my mean x by age and quarter, so I want to carry out a bootstrap for each group. I am trying to do this within a loop, so I don't
2011 Apr 16
1
Matching Problem: Want to match to data.frame with inexact matching identifier (one identifier has to be in the range of the other).
...rep("B",5)),c(1:5,1:5)),stringsAsFactors=FALSE) names(d1) <- c("ID", "Month") d1[,"Month"] <- as.integer(d1[,"Month"]) #Quarterly data, i.e. the value of every quarter has to be matched to several months in d1 #However, I want to match fiscal quarters, which means that one quarter is not necessarily 3 month long d2 <- data.frame(cbind(c("A","A","B","B"),c(1,3,1,4),c(2,5,3,5),c("v1","v2","v3","V4")),stringsAsFactors=FALSE) names(d2) <- c("ID", "Mi...
2008 Jun 05
7
Improving data processing efficiency
...rter, grab all the non-issuers in the same industry, sort them by size, and finally grab a matching firm closest in size (the exact procedure is to grab the closest bigger firm if one exists, and just the biggest available if all are smaller) 3. assign the matched firm-observation the same "quarters since issue" as the IPO being matched 4. rbind them all into the "matching" dataset. The function I currently have is pasted below, for your reference. Is there any way to make it produce the same result but much faster? Specifically, I am guessing eliminating some loops would be...
2012 Apr 18
2
quarter end dates between two date strings
Hello, I have two date strings, say "1972-06-30" and "2012-01-31", and I'd like to get every quarter period end date between those dates? Does anyone know how to do this? Speed is important... Here is a small sample: Two dates: "2007-01-31" "2012-01-31" And I'd like to get this: [1] "2007-03-31" "2007-06-30"
2004 Jun 25
1
trouble using boot package
Hello, I am trying to carry out a bootstrap analysis (using the boot package) on a table and cannot work out how to get the results I need! I have a table ("d2") with 4 columns: "ID_code", "Age", "Quarter" and "StomWt". Age (0-5) and Quarter (1-4) are my strata Therefore I wish to estimate the confidence intervals for the mean StomWt for each Age
2008 Aug 18
1
Converting monthly data to quarterly data
...the beginning of a quarter for a particular year, ie some countries start in May or September, and also some countries have one extra month, some have two extra months so there's no way of deleting some rows with a simple command (I want to get rid of all extra data that does not fall into the quarters for each country), since the amount of data to get rid of for each country varies. I tried for example: i=1 denise<-data[((data$country)==unique(data$country[i]),] denise[,2]<- as.Date(denise$date, "%Y-%m-%d") denise2<-denise[order(denise[,2],decreasing=FALSE),] len<-length(d...
2013 Nov 13
2
Implementing Samba 4 in multi site environment
...and aroung 20 site office, in my head quarter office i have not more than 50 PC client and in every site office i have no more than 10 PC client to manage. every site office connected to head quarter office by openvpn connection in route mode so every site office has different network. let say head quarters office network is 172.16.0.0/24and site office network are 172.16.1.0/24 until 172.16.99.20.0/24. my plan is i will install dc in head quarter office and i will install additional dc in every site office that will replicate the directory only with the head quater office dc. so my question are 1...
2011 Sep 08
1
Seasonal and 11-day subset for zoo object
I have a zooreg object and I want to be able to generate a value for seasons and 11-day composites paste it onto my zoo data frame, along with year, month and days. Right now I have the following to work from: eg. dat.zoo.mdy <- with(month.day.year(time(dat.zoo)), cbind(dat.zoo, year, month, day, quarter = (month - 1) %/% 3 + 1, dow = as.numeric(format(time(dat.zoo), "%w")))) For
2009 Feb 19
2
table with 3 varialbes
I have the initial matrice: > *data.frame(Subject=rep(100:101, each=4), Quarter=rep(paste("Q",1:4, sep=""),2), Boolean = rep(c("Y","N"),4))* Subject Quarter Boolean 1 100 Q1 Y 2 100 Q2 N 3 100 Q3 Y 4 100 Q4 N 5 101 Q1 Y 6 101 Q2 N 7 101 Q3 Y 8 101
2006 Jul 25
3
Overplotting: plot() invocation looks ugly ... suggestions?
Hi WizaRds, I'd like to overplot UK fuel consumption per quarter over the course of five years. Sounds simple enough? Unless I'm missing something, the following seems very involved for what I'm trying to do. Any suggestions on simplifications? The way I did it is awkward mainly because of the first call to plot ... but isn't this necessary, especially to set limits for the