11
$\begingroup$

If an OP asks for a R library recommendation (policy under debate in another meta thread, I realize), and no acceptable recommendation exists, what is the policy regarding writing and posting code that accomplishes what the OP needs? In case this is out-of-bounds, what is the in-bounds way of suggesting that the conversation move off CV?

This pertains to a recent request for survival analysis software to support data not (obviously) supported by the R library survival. There is now a bounty on this request, so I'm being egged on to do something.

$\endgroup$
13
  • 5
    $\begingroup$ It would help if you would link to the threads that motivate your questions here for context. Are you referring to: Is there a standard way to treat events with unknown times (missing survival time data)? $\endgroup$ Commented Mar 6, 2019 at 21:52
  • 2
    $\begingroup$ +1, to whuber & Tim's answers below. Be aware, however, that you are still free to attempt to help the OP & provide an answer in the interim anyway. Eg, you can vote to close as off topic, & nonetheless post an answer. (Nb, this advice pertains to off-topic Q's, not, say, unclear Q's, where an interim answer may make everything worse.) $\endgroup$ Commented Mar 6, 2019 at 21:54
  • $\begingroup$ @gung, yes, I am referring to that one, but my question is (I think appropriately) general so that it qualifies as a meta. $\endgroup$ Commented Mar 6, 2019 at 22:18
  • 3
    $\begingroup$ Your question certainly qualifies for asking on Cross Validated Meta. But it still helps to provide more specific context. You can ask the general question & link to the thread that motivates it. $\endgroup$ Commented Mar 6, 2019 at 22:26
  • 4
    $\begingroup$ A bounty doesn't make a question on-topic or even good. It just means, usually, that the OP is willing to spend reputation in pursuit of an answer. (I've been frustrated sometimes that votes to close as off-topic or otherwise deficient aren't allowed while a bounty is on offer.) Note: Sometimes generous people offer a bounty on someone else's question, which they think is a good question. In those cases, it usually is a good question. $\endgroup$
    – Nick Cox
    Commented Mar 7, 2019 at 9:52
  • 2
    $\begingroup$ @NickCox, be aware that you can flag such questions. If they need to be closed, we can refund the offered bounty to the OP & close the Q. $\endgroup$ Commented Mar 7, 2019 at 12:29
  • $\begingroup$ @gung Wait! Wait! It seems to be the will of the community that the pedagogical quality of the ANSWER is what saves the question. You really shouldn’t close such questions until the answers have come in. Some answers take longer than others. Please don’t leave me stranded with an answer and no question. (That’s a Jeopardy nightmare. Shall we call that a Jeopardy case?) You can refund the reputation, but you can’t refund the time spent on a quality answer. $\endgroup$ Commented Mar 7, 2019 at 13:23
  • $\begingroup$ @gung Indeed. But the thinking behind the inhibition seems to be that bountied questions should be left as is to take their chance, so I tend to hold back. If -- as has not happened in my experience, but it's a thought experiment -- someone posted an offensive question and bountied it, I would not hold back. $\endgroup$
    – Nick Cox
    Commented Mar 7, 2019 at 13:31
  • 1
    $\begingroup$ @PeterLeopold That's a grey area. I agree with you that a good answer can save a thread. But how long are we supposed to wait for a good answer to do that? The main principle behind zapping poor questions -- and fairly promptly -- is that if the OP has a better question if they try harder to be clear and specific, then that's fine; otherwise we are not missing anything valuable. $\endgroup$
    – Nick Cox
    Commented Mar 7, 2019 at 13:34
  • $\begingroup$ @NickCox How long to wait? The bounty period? Well, I’m new here, and if I find myself in a Jeopardy state (answer with no question) then I expect the moderators would encourage me to ask-answer a new question so I’m not all-dressed-up-with-nowhere-to-go. ;) $\endgroup$ Commented Mar 7, 2019 at 13:48
  • $\begingroup$ Are you asking specifically about bountied questions? Or generally? I think you're asking about bountied questions and I am confusing the issue by commenting generally. As said, I wouldn't want to close a bountied question unless it was offensive or really bizarre. I once had, as a hypothetical and private example of a completely off-topic question, a question about personal relationships. But then one really did appear; it didn't last long and I wish sometimes I had kept a copy. $\endgroup$
    – Nick Cox
    Commented Mar 7, 2019 at 14:02
  • $\begingroup$ @PeterLeopold, it is possible for an answer to save a question, but generally questions should be judged on their own merits. The time & effort to post an answer aren't necessarily wasted. 1) They can help the OP. 2) For off topic Qs that are migrated (eg, to Stack Overflow), the rep transfers there. 3) For off topic Qs that are closed, but stay here, you keep the rep, & if there is an upvoted answer, the thread is not deleted. The only way to lose is if the Q is subsequently closed w/o any upvotes or comments & the answer has no upvotes, then Q's that stay here will be automatically deleted over time. $\endgroup$ Commented Mar 7, 2019 at 14:20
  • 1
    $\begingroup$ @Peter Waiting tends to be counterproductive, because during the wait period there is a relatively high likelihood that misleading or irrelevant answers will be posted. Experience teaches that putting a question on hold immediately is the best action to take when there is any concern about what a question is asking. On rare occasions users have flagged questions where they can offer a compelling interpretation and claim they have a good answer to offer; in such cases I have reopened those threads and I imagine other moderators have acted similarly to such flags. $\endgroup$
    – whuber Mod
    Commented Mar 7, 2019 at 15:57

3 Answers 3

17
$\begingroup$

If code is the full answer to a question, then the question is off-topic. When the code illustrates or implements a statistical answer, such as a procedure or algorithm offered in response to a question about statistics or machine learning, then it is almost always warmly welcomed.

$\endgroup$
1
  • 2
    $\begingroup$ OK, I will focus on how I can teach survival analysis by hand: minimize -log(likelihood) w.r.t. the parameters of the cumulative hazard function, which is should be on-topic, and then illustrate with code, etc. I indicated in my original answer that this is easier than making sense of poorly written manpages, anyway. $\endgroup$ Commented Mar 6, 2019 at 22:31
12
$\begingroup$

A question asking for software referral is not on-topic, unless it needs some kind of statistical expertise. The same applies to questions about code. So, for example, a question asking about R packages for reading Excel files, plotting social network data, or asking how to implement linear regression in Python, etc. would be off-topic.

On the other hand, asking how to translate some theoretical paper to some practical problem, including implementing it, would be on-topic.

The distinction is often blurry, but the general rule pivots on whether the question asks about programming or about statistics. For me, the easiest way to tell what kind of question it is would be to consider if the question could be answered using pseudocode, ignoring all the language-specific and implementational details. If it can't, it's about programming.

$\endgroup$
1
  • 5
    $\begingroup$ I like your pseudo-code test, and as @whuber suggests, I will keep the focus on the pedagogy. $\endgroup$ Commented Mar 6, 2019 at 22:37
2
$\begingroup$

Consider taking a long-term view and writing a new package

One thing that is worth bearing in mind in regard to this query is that questions on CV.SE (particularly if they are fairly regular questions) can give a useful indication of "gaps" in the market for software tools to perform a particular task. If you have sufficient expertise to write code to implement some task (where that task is not already accomplished well in an existing package) then it is worth thinking about whether you might want to turn that into a bigger project where you write and publish a more comprehensive package to assist users with methods of that kind. If you are willing to do that then you might possibly create something of broader value, and you can also come back to the question later and make reference to your published package. Of course, this is a large amount of work, so it is generally only a good idea when you observe a set of questions that ask about similar things, and this provides the impetus to create a suite of functions that accomplish a broad range of tasks that answer those questions.

I speak here as someone who has done this quite a few times on this site. I have written three R packages (stat.extend, ts.extend and utilities) that largely came out of writing functions to solve problems from users who asked questions on this site. (Of course, all of these packages are quite general, and they do a lot more than answer the specific questions that initially motivated them, but that was the impetus for starting each of the packages.) I have answered a whole bunch of questions on CV and SE (see e.g., here, here, here, here, here, here, here, here, here, here, here, here, here, here, here, here, here, here, here and here) where the answer shows how to use one of those packages to solve the question at issue. In some cases, the question was asked before I had written the package, but it served as part of the motivation for creating the package. Writing these packages allows me to give simple user-friendly answers to all questions that ask for implementation of the kinds of problems in the original questions that motivated package.

$\endgroup$
1
  • $\begingroup$ I too have written, on several occasions, software later made publicly available given the stimulus of someone else's question in a forum. So yes, I agree strongly and this is worth saying. But it does not bear directly on what you should or should not do on CV given a question. $\endgroup$
    – Nick Cox
    Commented Feb 6, 2021 at 11:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .