Jason Morgan
  • Member for 10 years, 11 months
  • Last seen this week
When should I *not* use R's nlm function for MLE?
17 votes

When to use and not to use any particular method of maximization depends to a great extent on the type of data you have. nlm will work just fine if the likelihood surface isn't particularly "rough" ...

View answer
How to aggregate by minute data for a week into hourly means?
Accepted answer
14 votes

Here is one approach using cut() to create the appropriate hourly factors and ddply() from the plyr library for calculating the means. library(lattice) library(plyr) ## Create a record and some ...

View answer
Rules of thumb for "modern" statistics
11 votes

Think hard about the underlying data generating process (DGP). If the model you want to use doesn't reflect the DGP, you need to find a new model.

View answer
Confusion over lmer and p-values: how do p-values from memisc package compare to the MCMC ones?
Accepted answer
11 votes

I am the original author of the getSummary.mer function. The reported $p$-values should only be used as a quick check. If I recall, I actually only included the $p$-values to make it work within the ...

View answer
How to add non-linear trend line to a scatter plot in R?
10 votes

Without knowing exactly what you are looking for, using the lattice package you can easily add a loess curve with type="smooth"; e.g., > library(lattice) > x <- rnorm(100) > y <- rnorm(...

View answer
Clustered standard errors and multi-level models
Accepted answer
10 votes

When you cluster on some observed attribute, you are making a statistical correction to the standard errors to account for some presumed similarity in the distribution of observations within clusters. ...

View answer
How do you calculate eigenvector/value of a non-square matrix in R?
Accepted answer
7 votes

According to the man page, svd returns a list with the following elements: d: a vector containing the singular values of x, of length min(n, p). u: a matrix whose columns contain the left ...

View answer
How to calculate centrality measures in a 4 million edge network using R?
Accepted answer
7 votes

What you have is an edge list, which can be converted to a network object using the network library. Here is an example using fictitious data. library(network) src <- c("A", "B", "C", "D", "E", "...

View answer
Fit a robust regression line using an MM-estimator in R
5 votes

By default, the documentation indicates that rlm uses psi=psi.huber weights. Thus, if you want to use Tukey's bisquare, you need to specify psi=psi.bisquare. The default settings are psi.bisquare(u, c ...

View answer
Review of case control matching algorithms?
Accepted answer
5 votes

For an overview of some matching algorithms as well as clear examples of applications in everything from education to medical experiments, I would suggest: Paul R. Rosenbaum (2010). Design of ...

View answer
Ran a logistic regression and calculated the probabilities but they appear too high
2 votes

As @CliffAB mentions, interpreting changes in the odds on the predicted probabilities scale can be tough. But this is where graphing comes in handy. For instance, let's generate some data following a ...

View answer
What are some examples of public datasets that have randomized instruments?
2 votes

Donald Green in Yale's political science department has posted the replication data for many of his experiments. You can find them here: Donald Green's Replication Data Green is also the director ...

View answer
How to detect a significant change in time series data due to a "policy" change?
1 votes

Looking through some old notes on structural breaks, I have these two cites: Enders, "Applied Econometric Time Series", 2nd edition, ch. 5. Enders discusses interventions, pulse functions, gradual ...

View answer
How to estimate time-per-product in a factory?
1 votes

If you are interested in the amount of time it takes to complete an order, it seems that a duration analysis (aka survival or event history analysis) would be most appropriate. See the Wikipedia entry ...

View answer
Survival Model for Predicting Churn - Time-varying predictors?
Accepted answer
1 votes

Thank you for the clarification, B_Miner. I don't do a lot of forecasting myself, so take what follows with a pinch of salt. Here is what I would do as at least a first cut at the data. First, ...

View answer
Trend or no trend?
1 votes

The ADF test has weak power and, as Dmitrij Celov mentioned, you should probably also check the results of PP and KPSS tests. If you find that your results are on the margin of detecting a unit root, ...

View answer
Compressing data using wavelets with R
0 votes

Not sure if this will be helpful, but a 2007 article in JSS introduces the waveD library for R. http://www.jstatsoft.org/v21/i02

View answer