tttjjj/elt_bench huggingface dataset:
Apologies for previous comment; it was posted by pressing return by accident. Data come from a neuroscience experiment. We recorded the responses of two categories of neurons (x and y) under two different conditions (1 and 2). Data in each sample vector correspond to a Fano factor metric (scalar) calculated for each neuron and condition. For some neurons the metric is not available for both conditions which results in samples of unequal sizes. Samples do overlap, but as I said x1 appears to be different to x2 and y1 to y2.
However you should make a strong assumption that each class is distributed according to a well defined distribution, e.g. a Gaussian.
@suncoolsu, I do not know how exactly costly it is. I added the comment purely on the ground that any unnecessary operation is costly. On the other hand data.frame is special type in R, so there surely is additional cost of converting to it, not withstanding that passing the object to the function is effectively creating additional copy, so if speed is required this  should be preferably avoided.
Hint: how many parameters are you trying to fit compared to the amount of data you have?
#1 is tough to answer because when the sample size is doubled, who knows what will happen to the mean difference and the variance?  The person who posed that question may implicitly be supposing that you aren't to be thinking about changing these variables operationally, but purely hypothetically in the sense that all other terms are assumed to remain the same.
Hi Dikran, I added an addition to my original question based on your response.
You are absolutely right. I think we could get into a lengthy theoretic discussion: Asking the right questions yields the right answers: here, and generally. As a newcomer to a field sometimes it is the hardest to determine what is it that you are missing in your idea. I certainly feel that I am missing parts, just yet not sure what they exactly are. As you grow knowledgable questions get more precise, actually being able to ask better questions means getting better at something. Thanks for the guide, I'll keep that in mind! Hope we'll discuss more precise questions some day!
Could you please describe more precisely how you convert "items" to z-scores?  What kind of data value does an "item" have and how are the four items related?  Why do you provide examples with only two mean scores instead of four?
@Glen_b No It is not an exact polynomial.Yes I have an upper limit of degree 3-4
I'm sorry; I had thought you were taking $a$ and $b$ to be integral. The issue with factorials is readily addressed by using Gamma functions. The issue with $a-k\\lt 0$ needs to be looked into, because then the original simplification is not correct. An initial transformation of the hypergeometric function using one of [Euler's transformations](http://mathworld.wolfram.com/HypergeometricFunction.html) is needed, such as $\\,_2F_1(b,-a+k+1,b+1,1-z)=z^{k-a}\\,_2F_1(1,b+a-k,b+1,1-z)$, and then the same analysis can be applied. I haven't the time to carry this out for you now.
+1 Re the last statement: I once made the mistake of thinking that too.  Mathematically you're correct but in practice it's nearly impossible to approximate a non-differentiable spike with normals (such as J- or U-shaped distributions): the normals are just too flat at their peaks to capture the density in the spikes.  You need way too many components.  Normals are good for approximating distributions whose pdfs are very smooth.
I think that you can start with $AP$ instead of $AP^T$. In that case there is no problems with a transpose. whuber: an idea to vectorize matrices is very nice.
I have made an edit that I hope clarifies things somewhat. If I've missed something, let me know.
Depends also on the number of items. It makes a difference whether you have three or 15 items with loadings around .5. In the end, it's a question of reliability, isn't it. Maybe rules of thumb / cutoffs on reliabiltiy are more helpful then on loadings / squared multiple correlations?
You may already know this, but maps with ZIP codes are going to be odd. There are some ZIP codes that are a single building and that have no residents. The largest ZIP code, 89049 is over 800 square miles.  What is the purpose of this map?
In many situations, there is no such thing as *a* non-informative prior, because it depends on how the state space is parameterized. So exactly *which* "non-informative prior" would you hold out as being equivalent to a non-Bayesian analysis?
Glad to hear it.  Knowing what has worked is not the same as finding what works for you.
Related: http://stats.stackexchange.com/questions/138/resources-for-learning-r
Ok, thanks. Is there a way to just switch it over or do I have to repost? 
And thanks to Patrick Coulombe for adding LaTeX. I looked around to try to do that and couldn't figure it out, now that I can see the side-by-side markdown in edits it helps.
@P Sellaz Oh, I see. And please also read my last paragraph that I just added. I am not sure about your research question but I felt that can be a potential problem.
Thanks - I know I will need the log-likelihood to get the DIC, but I still don't know how to actually calculate P(D|theta)
@PeterFlom: The LS solution gives poor results for the first one, I want to know the reason. And yes, it's the last paragraph of the section about LS classification where the whole chapter is about Linear discriminant functions.
I suspect there is something suitable in the list of software packages here: http://www.gaussianprocess.org/#code .  I use the GPML Matlab toolbox myself, so I can't offer a useful opinion on the other packages.
Understanding *systematic* errors is the key. Let $\\mu$ be the critical temperature (CT). Let's posit that the expected CT *measured through heating* equals $\\mu-\\delta_h$ and *measured through cooling* equals $\\mu+\\delta_c$. I presume a value like $6942\\pm 20$ represents the mean and standard error of some heating measurements; $6959\\pm 19$ are the mean and SE of some cooling measurements. It will be hard to estimate $\\mu$ *because you have little information about* $\\delta_h$ or $\\delta_c$. You *can* estimate $(\\mu-\\delta_h)+(\\mu+\\delta_c)/2$ = $\\mu+(\\delta_c-\\delta_h)/2$.
Dear Clark, Thanks so much for taking the time to answer my query.
+1 Package demands heavily depend on each individual and I think Task Views are the way to start anyone.
Clarify notation please. Say, what does $f_F(2)$ represents (in words) -same for the rest. Also, which is the "second state"? Finally I feel there is a slight inconsistency in the impression that the verbal description of the set up leaves, and the probabilities shown in the diagram. The text talks about "occasionally switching to a loaded die" -which is validated by the $F\\rightarrow L$ probability of only $0.05$. But once we are in the "loaded die state", there is a $0.9$ probability that we will stay there... this is much stronger than an "_occasionally_ dishonest" casino!
I worked through your example and then tried it on my own data. When I do the FE-IV I get the error message: equation exactly identified. Well, I have two instruments as in your example so I should not get that message. Any idea what is going on? I tried it with and without controls same story.
I agree with @ACD that a MICE package can be used to impute categorical data like yours.  I don't think "hierarchical data" applies here, which simplifies your task.  Still, doing it in R is no simple task.
"the model says I have a 60% chance to win. I can't win 60% of one game, and if I lose the prediction isn't exactly wrong, now is it?" In this case, if the model says 60% chance of winning, then you would choose win as your selection (you have to choose win or lose) and if it was lose, then the model would be incorrect.  I'm assuming that this model is being built for some kind of sports forecasting/gambling?  There is no 100% gimme winners or losers in sports.  Everything is a matter of probability.  So if the model says 80% to win, and that teams loses, yes the model was wrong.
I didn't know about them, thanks Radek.
Thanks, that's what I thought but I wasn't sure..
I take it that by "volatility clustering" you mean that it appears that the time series is characterized by different variance in different intervals. First, this is just an indication of possible non-stationarity, not proof. Second, the ARCH model and its extensions attempt to explain this "volatility clustering" by modelling the _conditional_ variance as time-changing, while maintaining the assumption of a constant _unconditional_ variance (and hence, the assumption of 2nd-order stationarity).
Thanks for your comments! @GaëlLaurans, I thought of using hierarchical regression to assess the contribution of the control variables first, then the IVs, and finally also the interaction terms in the model. I have seen that in some tutorials about hierarchical regression analysis... My idea is interpreting the results after each step. Would that be correct?
This appears to have no relation to the question, specifically about code on Github,
Let's try a role reversal: You're in a seminar, or reviewing a paper, or examining a thesis, and the other person says "I chose such-and-such link because it gave the best fit, and nothing else really matters". Do you think "Fine by me"? I would want to ask lots of questions, not least: does that mesh with the known science here? can you show graphically that the model looks about right? have you looked at residuals and failed to find patterns? what other models did you think about and do they perform as well or much worse? are you confident that you have a defensible set of predictors?
Please check if I edited your formula correctly, and update if necessary.
Yes agree - this is just intuition. The following paper gives conditions for the existence of unbiased estimator for a function of a univariate gaussian mean - maybe can be extended to multivariate: 
http://www.stat.ncsu.edu/library/mimeo.archive/ISMS_1988_1929.pdf
@gung I think the probability of all 10 answers being A is (1/3)^10, while the probability of all 10 anwers being the same is (1/3)^9
This answer raises the question of exactly what you *mean* by "degree of freedom."  What is your definition of it and why is it relevant?
This is more than an observational vs. randomized issue but there is a relationship to HRT studies.  You might be right that some careful reasoning might justify treating the results as providing a lower bound.
A Box-Cox parameter of zero corresponds to the *logarithm,* not the zero power.  It sounds like you would benefit from reading some more background about this technique before proceeding further.
Compensate how? What kind of statistical analysis are you proposing to do with these data?
Ah yes - it's the extension of my suggested proof to vectors. Compare the MGF of the given distribution with the MGF were the components independent; since they are the same and MGFs uniquely determine joint distribution, the joint distribution _is_ the independent one.
...For instance, what if I don't know of any relation between cat ownership and horror movie fanship? Or, what if it is possible to be both a cat owner and horror movie fan?
Could you post the output from summary() and anova() that shows the exact problem?
Bayesian methods are theoretically well suited for real time analyses because the essential Bayesian method is to take a prior belief, and using a bit of data, compute a posterior belief -- which can become the prior for a new cycle.  While that part sounds good, there are practical difficulties and significant hurdles in specifying interesting models on real, changing data that are tractable and easily computable.
Did you mean $S(t)$ and not $f(t)$, which is usually reserved for the density?
@Thomas the latter: the sum of the realizations should be zero. Could you please clarify the last part of you comment? How would I solve this?
It is all the same as $H_0:\\beta_0-\\beta_1=0$, isn't it? More over you could also test $H_0:\\frac{\\beta_0}{d\\beta_1}=1$ by constructing a contrast matrix $L$ such that $H_0:\\beta_0-d\\beta_1=0$.
"no demonstration whatsoever" seems a wild exaggeration to me, but if it's your perception I think you are expecting extraordinary rigour in proofs.
As my answer already suggests, what is 'close enough' for your purposes depends on your purposes and your tolerance for effects on significance and power. I can't tell you where to draw those lines and I expect my own ideas of 'close enough' for my applications would seem strange choices for yourself and your applications. For a one sample permutation test of location, if you are prepared to assume symmetry about $\\mu_0$ under the null, then you can subtract $\\mu_0$ from each observation and write each deviation observation as the magnitude (absolute value) x its sign, &then permute the signs.
Is this homework? If so, it should have the `self-study` tag
I rarely work outside the regression context but I can't imagine why you would replace NAs with 0 instead of mean/median.  If want to do better, consider multiple imputation with cross-validation.  And always ask yourself why data is missing.
I had wondered about this. I guess I didn't figure the problem would be this large. I think you might be right though.
Welcome to the site, @user20998. It's not clear how much data you have. What is your N? Also, are the same units measured repeatedly over this 4 year period, or are the units independent? Do you still have the components of the ratio?
Haha, yeah, to be honest, that crossed my mind as I was responding and then I thought, "I don't know how to deal with that - I'll just post what I have." It should be a fairly trivial consideration if your sample is already n>=30 but I'm not sure what to do about very small samples. Hopefully someone else can chime in here.
Yes. Only the control group is all 100%
Thanks! I have now edited the answer including some specific calculations. The question does not explain how $\\lambda$ and n have been obtained, so I made an educated guess. As you say, if n differs too much from $\\lambda$ is the first hint that the model may not be Poisson or the measurement was not done right. One way to check it is precisely calculating the 95% confidence interval which, in this case, shows n is outside the interval.
@SheaParkes thanks for the comments and answers Shea. I'm actually using the neuralnet package - see comment above.  It uses a resilient backpropagation algorithm with weight backtracking
Package recommendations: **amer** — Additive mixed models with lme4, **gamm4** — Generalized additive mixed models using mgcv and lme4, **mgcv** (gamm function, via glmmPQL in MASS package), from [here](glmm.wikidot.com/faq)
My data consists of counts of items that reach a certain level of damage (1 to 5), for values of a continuous demand parameter i.e. the explanatory variable. So this is not a time series - although this may not be what you mean by "temporal aspect"?
I've changed the question to make it less of a homework question.
First, could you elaborate on what you mean by "subjects could contributes to both boxes"? Do you mean that the questions weren't two-alternative forced choice questions?
Second, I would expect that you didn't assign objects to "att", "neut", and "ug" groups without some reasoning behind it. That being said, counting the number of responses that show preference to the more attractive option shouldn't presuppose anything about your treatment (i.e. If a subject made 4 choices in the ug vs. att condition, they could have chosen "ug" 4 times, which is the same as choosing "att" 0 times).
Ok. Thank you very much for your explanation. I must include this procedence in the analysis as it's one of the most interesting procedences in other measured variables. So indicating what @Hong Ooi explained in the flowering results solves my headache with this data. Again thanks!
Could you please provide a reference to that "somewhere" for those who are struggling to understand exactly what it might have said?
A random walk consisting of a +1 move 53% of the time, and a -1 move 47% of the time.
I own that one.  It was the textbook for one of the courses in my masters program, so I have read it aggressively.  It is all in SAS (I'm a MatLab guy) but more importantly - although it enumerates the procedure to implement each of the styles of optimal DOE, it does not give a characteristic application.  For instance, there exists a variation on c or L optimality that accounts for the cost of executing the particular experiment but there is no "canonical" example showing its implementation, nor a discussion of why it is the canonical example.
I didn't notice the mention of homework before. Since it's in connection to a homework problem, please add the `self-study` tag, and check the [tag wiki info](http://stats.stackexchange.com/tags/self-study/info). When you say 'further understanding' I assume you're not actually doing a homework problem, just trying to understand one... is that right?
non-linear regression is a huge field! You should say something about your preferred application area, which will make it easier to give advice.  A similar question (with answers) http://stats.stackexchange.com/questions/25608/non-linear-regression-references        http://stats.stackexchange.com/questions/8570/references-on-numerical-optimization-for-statisticians/10166#10166
His outcome is a score on a multiple choice written test.
+1 Note that $c$ also depends on $n$.
Welcome to the site, @caedocyon. This looks like a nice contribution--I hope we'll see more. Let me note a couple of (admittedly small) points: I suspect $\\sigma^2I/k$ is a diagonal matrix of *variances*, not SDs; also, since this is a multivariable situation, it might be clearer to state that $\\beta$ is the mean *vector* / the vector of slopes from the original model. (NB, I haven't read the paper, these are guesses, feel free to correct me if I'm wrong.)
Why don't you just try it out and tell us how it goes? is "n" decided before hand for each exercise? maybe you can just predict k and introduce n as an independent variable. If you are interested in p=k/n why don't you just predict that?
**ANOVA** means ANalysis Of VAriance - that's exactly what the OP needs.
Believe this to be overly broad and not constructive. You are asking the software to think for you without specifying a specific pattern to identify.
I believe your take on me asking to "be corrected where wrong" has been the best response so far.  I suppose I needed a few null hypothesis refuted or to learn by process of elimination.  Your response has given me new information I understand - there are still some big holes in my understanding of the topic, but I can't expect perfection.  Perhaps those holes are bigger than I originally anticipated when writing this question and stackexchange wouldn't suffice, no matter how "chatty" I made the question.
Here is a [related question](http://stats.stackexchange.com/questions/8661/logistic-regression-in-r-odds-ratio). There are several others as well, e.g., [this one](http://stats.stackexchange.com/questions/14634/reporting-results-of-a-logistic-regression).
I am not sure I understand the difficulty. If the functional form is known just take the derivative otherwise take differences. Am I missing something here?
Thanks so much for this! I guess the answer cannot come from a better source! Also, can the different approximating distributions for the variables be from different distributions (gamma, multivariate normal etc.) as long as they are from the exponential family?
I guess is related the way in the variables are relationated see `attr(terms(lm1),"factors")` and `attr(terms(lm2),"factors")`
Is it this one: http://www-stat.stanford.edu/~tibs/ElemStatLearn/datasets/mixture.example.info ?
Whether or not the central limit theorem has effectively "kicked in" by a given sample size depends on the distribution of the data. In most cases that come up, $n = 300$ in each group would be enough. It's mainly unusual examples that "break" the CLT for finite samples. For example, if your data were all Bernoulli trials with success probability $p = 10^{-9}$, your sample of $n=300$ outcomes would almost certainly be all 0s, so the sample means are, of course, not approximately normal - a much larger sample size would be required.
Note that the null hypothesis is that the difference in means is greater that a specified delta (the window of equivalence).
Do you mean the  values after imputation? Do the non-missing values also have this range?
The point @user603 makes is that words like "syslog" are terms of art in specialized areas. You cannot expect or even hope that people in a statistical community will be familiar with every technical term used somewhere. Nevertheless, it is often the case that procedures used in one application domain are used (but known by different names) in other domains, so it is possible this community can help. If you would like your question to be understood correctly and by more than a handful of readers, then please expand it. Otherwise it would appear to belong in a different forum altogether.
For one dimension, inverse transform sampling is indeed a good thing to use. The problem with discarding points outside a sphere is that in high dimensions, you end up discarding nearly 100% of your points.
Thank you Kevin - I went with this option, went a head and ordered his book.
I'd suggest looking at graphical summaries of the estimated effects. Here are two papers that give suggestions, ([Gelman et al, 2002](http://www.stat.columbia.edu/~gelman/research/published/dodhia.pdf); [Kastellec and Leoni, 2007](http://svn.cluelessresearch.com/tables2graphs/kastellec_leoni.pdf))
@Jase: It does address the *main* reason for standardization, which you omitted from your list: if you want to drop predictors with small coefficients (or otherwise use a penalty term depending on coefficient magnitude), you need to decide what counts as "small". Though standardization isn't mandatory before LASSO or other penalized regression methods, it's rarely the case that the original scales the predictors happen to be measured in are useful for this purpose.
It doesn't make sense to use a Jarque Bera test with $n=12$, since (i) it relies on an asymptotic approximation that doesn't kick in until $n$ is well into the hundreds, and (ii) a formal hypothesis test really answers the wrong question (we know the data won't be exactly normal; the question is really how badly we might be affected by potential non-normality, which the test doesn't speak to.
Please follow the link through [tag:generalized-least-squares] for related questions.
Consider starting your research at http://stats.stackexchange.com/questions/2691/making-sense-of-principal-component-analysis-eigenvectors-eigenvalues so that you can appreciate what PCA does and what the limitations might be.  (There's no way you can even approximate the original dataset from the information given.  You could do a rough job if, in addition, you had the eigenvalues or their equivalents along with the six components you have retained.)
[Is this a duplicate?](http://stats.stackexchange.com/questions/71919/whether-to-categorically-code-likert-predictors-in-binary-logistic-regression-in)
900 sounds way too small for full covariance matrixes. See: 45^2 entries per matrix, and now assume you have just 2 clusters, that is 4140 parameters in your model. As a rule of thumb, you should have $3*d^2$ observations in each cluster at minimum.
Seeing as you are a programmer, an approach emphasizing simulations might be advantageous, and it might also kickstart your R-skills. I'm curious though: do you want a "for dummies"-like book or just a good introductory undergrad-level book.
Browsing our companion site, Stack Overflow, for technical and programming-related questions about R, I believe you will find a lot of clues for this rather vague question. If this is about running script, try [this one](http://stackoverflow.com/questions/750786/whats-the-best-way-to-use-r-scripts-on-the-command-line); or more generally, [this query](http://stackoverflow.com/search?q=%5Br%5D+%2Bcommand+%2Bline&submit=search).