I have a dataset of 30 social variables such as Facebook Likes, Posts, Comments, etc. I would like to see if these variables predict Website Views.

MY problem is I only have 3 months of data- or 3 data points. Thus I have a 3 by 30 dataset. My question is, how do I model with such few data points but lots of variables?

In addition, I would love a resource that walks through regression in R. My data does not even remotely look linear, so I don't know what to do next. Suggestions?

  • $\begingroup$ Welcome here. Please split your questions into separate threads $\endgroup$
    – sheß
    Commented Apr 21, 2016 at 22:24
  • 9
    $\begingroup$ 3 observations, 30 variables implies that you need many more observations. Even 30 observations and 3 variables would be a stretch. $\endgroup$
    – Nick Cox
    Commented Apr 21, 2016 at 22:37
  • 3
    $\begingroup$ This can not be done. Your linear regression is what we call underdetermined. Because you have way more variables than you do observations, linear regression won't be able to pick out coefficients that minimize the sum of squared errors. There are, literally, an infinite number of coefficients that would do so, which doesn't sound very useful. You are going to need to wait for more data. $\endgroup$ Commented Jul 7, 2019 at 15:51
  • 3
    $\begingroup$ You need more data. People are suggesting using regularization or local methods, but both will give highly variable results. Frankly, your inference will be questionable even if you take a simple average. $\endgroup$
    – Josh
    Commented Jul 7, 2019 at 16:22
  • 2
    $\begingroup$ I may be missing something, but why do 3 months of visits result in 3 data points? Why not summarize by day? That would give you 30x more observations. $\endgroup$
    – burger
    Commented Jul 8, 2019 at 19:28

2 Answers 2


You have insufficient data. Start with the Rules of thumb for minimum sample size for multiple regression thread, with thirty variables you would need at least a few hundred samples. With three samples, you could try fitting a model with one parameter, intercept-only model, i.e. calculate the mean of the dependent variable, but still, three samples would be very little for this as well.


Yes, as Nick mentions, it is definitely a stretch for using models with assumptions. If you just want to predict, I would suggest that you use nearest neighbor method as a non-parametric method for prediction.

If you have little more points, you can use partial least squares (PLS) if more variables than data points.

As pointed out by others, three data points is too few for developing a regression model. I would suggest to collect at least 20 data points to run a regression model.

  • 4
    $\begingroup$ This really isn’t appropriate given the size of the data set. Op should collect more data before considering any modeling. $\endgroup$ Commented Jul 7, 2019 at 16:11
  • $\begingroup$ @DemetriPananos, I agree that it would be ideal to collect more data. But in case, only data point is available, that is the best guess. In case, only two data points are available, the outcome of the closest one to the test data is the best guess, so on and so forth. These are be written into the code until sufficient data has been collected to do any proper modeling. $\endgroup$
    – KarthikS
    Commented Jul 8, 2019 at 1:57
  • 1
    $\begingroup$ I'm not trying to answer if OP can make predictions, I'm answering should OP make predictions. No worthwhile predictions can be made from 3 data points housing 30 measurements. Telling OP otherwise is at worst negligent and at best shows a gross misunderstanding for the modelling processes. $\endgroup$ Commented Jul 8, 2019 at 2:28
  • $\begingroup$ You are right. I will update my answer to suggest that nearest neighbor is not really a model and for 3 data points, it really works only as a heuristic. $\endgroup$
    – KarthikS
    Commented Jul 9, 2019 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.