What is the best way to determine if pageviews are trending upward or downward? Given the following dataset for a single article on my site:
Article 1
2/1/2010 100
2/2/2010 80
2/3/2010 60

Article 2
2/1/2010 20000
2/2/2010 25000
2/3/2010 23000

where column 1 is the date and column 2 is the number of pageviews for an article. What is a basic acceleration calculation that can be done to determine if this article is trending upwards or downwards for days I have pageview data for it?
For example looking at the numbers I can see Article1 is trending downwards. How can that be reflected in an algorithm most easily?
thanks!
 A: General thoughts about pageviews
I think there is a fair amount of domain specific knowledge that can be brought to bear on page views.
From examining my Google Analytics statistics from particular blog posts, I observe the following characteristics:


*

*Large initial spike in pageviews when an article is first posted related to hits coming from RSS feeds, links from syndication sites, prominence on home page, spikes related to newness and social media.
This effect tends to decline rapidly, but seems to still provide some boost for a few weeks.

*Day of the week effects. At least in my blog on statistics, I get a consistent day of the week effect. There is a lull on the weekend.
The implication is that if I were trying to understand meaningful trends in an article, I would be looking at changes from week to week rather than day to day.

*Seasonal effects: I also get more subtle seasonal effects presumably related to when people are working or holidays and for some posts more than others when university students are studying or not. For example, the week between Christmas and New Years is very quiet.

*After the initial spike, I find most traffic is driven by Google searches, although a few posts derive considerable traffic from links from other blogs or websites. Links from Social media and blog posts tend to lead to abrupt spikes in page views and depending on the medium may or may not lead to a consistent stream over time.


Implications for identifying upward or downward trends in a page


*

*The above analysis provides a general model that I use to understand pageviews on my own blog posts.
It is a theory of some of the major factors that influence page views, at least on my site and from my experience.
I think having a model like this, or something similar,  helps to refine the research question.

*For instance, presumably you are interested in only some forms of upward and downward trends.
Trends that operate on the whole site such as day of the week and seasonal trends are probably not the main focus.
Likewise, trends related to the initial spike in pageviews and subsequent decline following a posting are relatively obvious and may not be of interest (or maybe they are).

*There is also an issue related to the time frame and functional form of trending.
A page may be gradually increasing in weekly pageviews due to gradual improvements in its positioning in Google's algorithms or general popularity of the topic of the post.
Alternatively, a post may experience an abrupt increase as a result of it being linked to by a high profile website.

*Another issue relates to thresholds for defining trending.
This includes both statistical significance and effect sizes.
I.e., is the trend statistically significantly different from random variation that you might see, and is the change worthy of your attention.
Simple strategy for detecting interesting trends in pageviews
I'm not an expert in time series analysis, but here are a few thoughts about how I might implement such a tool.


*

*I'd compute a table that compares pageviews for the preceding 28 days with the 28 days prior to the most recent 28 days. 
You could make this more advance by making time frame a variable quantity (e.g., 7 days, 14 days, 56 days, etc.).
The more popular the page (and the site in general), the more likely that you are going to have enough page views in a period to do meaningful comparisons.
Each row of the table would be a page on your site.
You'd start with three columns (page title, current page views, comparison page views)

*Filter out pages that did not exist for the entire comparison period.

*Add columns that assist in the assessment of the effect size of any change, and the statistical significance of any change. 
A simple summary statistic to use would be percentage change from comparison to current. You could also include raw change from comparison to current.
Perhaps a chi-square could be used to provide a rough quantification of the significance of any change (although I'm aware that the assumption of independence of observations is often compromised, which also raises the issue of whether you are using pageviews or unique page views).

*I'd then create a composite of the effect size and the significance test to represent "interestingness". 

*You could also adopt a cut-off for when a change is sufficiently interesting, and of course classify it as upward or downward.

*You could then apply sorting and filtering tools to answer particular questions.

*In terms of implementation, this could all be done using R and data exported from tools like Google Analytics. There are also some interfaces between R and Google Analytics, but I haven't personally tried them.

A: Simply build an ARIMA MODEL that separate signal from noise incorporating any identifiable deterministic structure such as changes in levels/trends/seaonal pulses/parameter or variance change over time. Develop a prediction for the next 5 days and use the uncertainty in that sum to create possible bounds. Compare the actual sum of the "new five readings" and compute the pobability of yielding a value as "high" or as diverse as this.
A: Jeromy Anglim and IrishStat both give great answers, but they sound maybe a little more complex than what you're looking for.


*

*A simpler method could could be to perform a linear regression on your data, to get PageViews = a * Date + b for some constants a and b; the constant a is then a measure of the linear "slope" of your data, which you could use to measure how much the link is trending. However, this might not work so well if your data doesn't follow a linear trend (the example in your other link looks pretty linear, but you could imagine that your link has instead been growing exponentially lately).

*So another approach could be to convert your pageviews into ranks (e.g., in article 1, 100 is the lowest value, so convert that into a 1; 80 is the 2nd-lowest value, so convert that into a 2; 60 is the highest value, so convert that into a 3), and then take the correlation of these ranks with (1,2,...,n) (where n is the total number of dates you have).
For example, if your article behaves like
Date, PageViews, Rank
June 1, 100, 1
June 2, 120, 3
June 3, 115, 2
June 4, 125, 4
June 5, 150, 5

Then you would take the correlation between (1,3,2,4,5) and (1,2,3,4,5) to get a trending score of 0.9. (Note that under this method, though, pageviews of (100, 120, 115, 125, 150) have the same trending score as (100, 300, 299, 7000, 35000), which may or may not be what you want, since the latter is growing faster. In other words, this method tells you how strong the direction of the trend is, but not the magnitude. If you do want to get a sense of the magnitude, then you could just repeat these methods on the day-by-day changes of pageviews, i.e., determine whether the day-by-day changes are trending upwards or downwards.)
