tttjjj/elt_bench huggingface dataset:
Your model is not the standard 2-way ANOVA, but using matrix math, the SEs can be found like in [this answer](http://stats.stackexchange.com/a/29518/1909). The SEs of the coefficient estimates are the diagonal of the matrix $\\hat{\\sigma} (\\bf{X}'\\bf{X})^{-1}$,
where $\\hat{\\sigma}^{2} = ||\\bf{e}||^{2} / (N-\\text{Rank}(\\bf{X}))$ is the estimate of the error variance
($||\\bf{e}||^{2}$ is the sum of squared residuals, $\\bf{e} = (\\bf{I}-\\bf{P}) \\bf{y}$, $N$ the total number of observations, and $\\bf{X}$ is the design matrix, and $\\bf{P} = \\bf{X} (\\bf{X}'\\bf{X})^{-1} \\bf{X}'$ the hat-matrix).
Thank You! This information is very helpful, I will try to configure my Emacs setup in a similar manner.  Regarding the operating system specific points, I am on Linux (Fedora 15), so I am not sure if that makes any difference in configuration/layout.
All manner of other things. Those three things are not an exhaustive list of things you might minimize. Mentioned relative efficiency (ratios of variances; asymptotic and small sample), there's MSE, but also other measures of relative performance not based off the 2-norm. Or you can look at what these functions minimize without regard to some assumed distribution - if you want to minimize the worst-case error, that's the infinity-norm. If you want to minimize the average absolute error, that's the 1-norm.  Without knowing more about what you want to achieve, it's hard to give clear advice.
I should have mentioned that the goal of running this model is to test whether the two subspecies of geese differ in time spent vigilant, whilst controlling for covariates. I'm not going to use the model as a prediction tool. Would that therefore excuse the model for predicting values > 100?
Awesome. Beeswarm looks like the way to go. Now to implement this with matplotlib using pandas DataFrames!
Welcome to our site!  Your statement shows you can be rusty at something and still ask a good question. :-)  I would suggest making your question a little more open-ended, though (and to that end I have attached the [tag:data-imputation] tag): rather than asking our opinion of a particular procedure that comes to mind, why not ask for suggestions about how to deal with your missing data problem?  That in turn suggests you might want to provide some additional information about the *purpose* of your analysis.
Amazing.  I`ll have to do some more reading then, thank you
If one of these answers works for you perhaps you might accept it or request a clarification.
@Donbeo PCA uses $\\lambda$. You are getting the results for : $X v= \\lambda {v}$ with PCA (`eig`). (The actual symbol used makes little difference)
(1) The anchors on the 4 point scale you report are clear.  This addresses your concern about unbalanced responding.  Perhaps it would be better to have two negative and two positive scale points, but I do not think the 4 point scale you described is a flaw.  (2) A factor analysis is based on correlations, so see my comment above on correlations.  What might a factor analysis indicate that would concern you?
You might appreciate [this recent answer](http://stats.stackexchange.com/questions/58220/what-distribution-does-my-data-follow/58241#58241) showing ways to identify modes in a distribution. Also of interest is [this thread](http://stats.stackexchange.com/questions/40454/determine-different-clusters-of-1d-data-from-database) on 1D clustering.  Searching our site on "clustering" is also likely to be fruitful.
It's actually ratio scale. "4 times" is really twice "2 times". But it's discrete (since it's a count), not continuous.
In the statement `model <- lm(y ~ x, data=df)` substitute sin(x) for x
Thanks again, Phil. For people browsing this thread in the future, I found a relevant example (6.15) in the Mplus User's Guide v7: http://www.statmodel.com/download/usersguide/Mplus%20user%20guide%20Ver_7_r6_web.pdf
@Brian I am not aware of any non-Stata implementations. Hacking together the marginal effect is pretty easy, but getting the standard error is non-trivial. At first, I thought that it would be easy enough to boostrap, but that is not working for some reason. I have added code.
This paper can probably help you: http://www.rbsd.de/PDF/ci_nnt.pdf (Calculating Confidence Intervals for the Number Needed to Treat - Ralf Bender)
A *derivation* means a logical connection from something assumed to something to be established. *What do you want to assume*?  What is your start? How do *you* define a Beta distribution, if not via its PDF?  BTW, Q3 is off topic here: we are a question-and-answer site, not a site that seeks questions when an answer is lying around!
Vector fields actually appear in a fundamental way within the answer at http://stats.stackexchange.com/questions/29121/intuitive-explanation-of-unit-root/29129#29129, showing that they can crop up in unexpected places.  Moreover, the comment thread after that answer suggests (to me, at least) that a very well established statistician would have appreciated this theory better had he had more training and practice in geometric and analytic methods.
I don't understand the question at all... what are you trying to do?
If you want to measure the constrain-ness of a parameter, what about to use st.dev(posterior)? If you want to compare constrain-ness of different parameters, what about to use st.dev.(posterior)/st.dev(prior)?
I consulted various sources but was not able to verify that the number of outcomes is part of SplitInfo. Which reference did you use ?
The package by Hadfield you reference does seem to 'jump right in' if you're new to Bayesian approaches. After looking around a good deal I found [Kruschke's](http://www.amazon.com/Doing-Bayesian-Data-Analysis-Tutorial/dp/0123814855) book to be the best introduction; as far as GLMModels, there's a good example with logistic regression which you should be able to generalize. As a beginner, I also liked [Gelmans](http://www.amazon.com/Analysis-Regression-Multilevel-Hierarchical-Models/dp/052168689X) book. Both are intended for those coming from non-math backgrounds.
Can you expand on the contrast coefficients? I use R to do my statistics. Would I just add a column to my data and assign a dummy code for each score depending on what instructional phase the score came from? Then do a two-way anova with time and phase and look at whether the factor of phase is significant?
From the first sentence alone I would not expect any method that fits a line (plane, hyperplane) to work well with your data: differences between robust and quantile are a separate issue. None of the methods so far discussed pays **any** attention to boundedness of the response. If you don't have exact zeros you might, just possibly, benefit from transformation; otherwise some generalised linear model might help. You are seeking oracular judgements on what is right or what is better that can't be given responsibly when you are only gradually revealing vital characteristics of your data.
Very good link, but please give some context, so if the link is dead, there still would be some idea about what is in it.
Let's consider a concrete, simple example; you have 5 slides from a person who has the pathogen.  What is the probability that you fail to correctly identify this person as having the pathogen?  A hidden assumption is that the presence / absence of the pathogen on a slide is independent of the presence / absence of the pathogen on other slides taken from the same specimen.
A score is required for both ROC and precision-recall curves. The score indicates how confident the classifier is that the sample belongs to the positive class.
A very good alternative to rank tests is to use permutation ANOVA's (http://www.uvm.edu/~dhowell/StatPages/More_Stuff/Permutation%20Anova/PermTestsAnova.html). With that approach heteroscedasticity does not matter. The main reason people use rank tests is because they are computationally much easier. That does not matter any longer. We have R and efficient computers...
Ah yes, I forgot about that. Whilst the default `predict` after `xtreg` is linear prediction (`predict yhat, xb`) you need to specify this for nonlinear models. So after the oprobit command you can use `predict yhat, xb`. If you found this answer useful you can accept it as answer to your question by ticking the check mark underneath the voting buttons :-)
@peter, this is likely a homework question, can you show us what you have done? You'll need Ito's Lemma for this (hints: $\\mu_t = 0$ and $\\sigma_t=1$ since the underlying process is Brownian motion). Can you compute $d(M(t))$? What happens when you square that term?
I don't know why you think the data are within Subject heteroskedastic. It doesnt matter if the data are between subject heteroskedastic to fit the ar(1) model. I am not even sure how you detect within subject heteroskedasticity. In ar(1) is ok so long as the variance between all the measurements of one person are the same and you only have at most one pair of measurements between a subjects say 4th and 5th observation. Basically ar(1) is ok if your time intervals are equal length.
@JeromyAnglim Thanks for your comments. This is related to visual sampling of an information processing task. Each button press is a request for visual sample of the world/system/monitor, and the subject is told to sample only when they have to (minimal information allowed to complete a task). There are multiple button presses in each trial, and it's related to the task going on, but not exactly 'triggered'. So here I am trying to show that people aren't just taking a visual sample at a regular pace, regardless of what is going on in the world.
Are you cross-validating the feature selection also? If the feature selection was done prior to the cross-validation on the same data set, the results from any cross-validation procedure are most likely optimistic. The feature selection step must be included inside the cross-validation loop.
+1 As you see, it can get really messy in higher dimensions.  I think even your computer algebra system will choke once $d$ gets larger than 4 or 5--if it handle this problem in full generality at all.
Hi Addam, thanks for that! Yes you are correct, I am trying to work out which, if any, treatments are better than the control/standard treatment. So to make sure I understand correctly, I can either run multiple t-tests comparing all the different groups or do a GEE?
It seems that you are asking several independent questions at once in this post. I'd recommend that you move at least the last question to a separate post, as this keeps the site tidy and makes questions and answers easier to find in the future!
@Glen_b Thanks, I do appreciate.
Sounds like you'd be better off treating them as separate independent variables as in your second comment. Is there any advantage that you're aware of so far in treating them as one variable? Some specific ways of framing your question might benefit from it, but unless you're already planning to address the general problem in some such way, I guess I wouldn't go there, because you'd then have to iron out the issue you raise in this question...whereas otherwise it shouldn't be a problem to just treat them as separate variables.
@RasmusBååth You should make that its own answer.  `Stan` is likely to become *the* piece of software for Bayesian models.
All that line does is take the derivative of $\\log(y)$ with respect to $y$ and multiply both sides by $\\partial y$. We have $\\partial y \\approx y_1 - y_0$. This fraction, then is the change in $y$ divided by $y$. Multiplied by 100, this is the percent change in $y$.
+1 purely for the advice on parameter optimization and model complexity. but all of this advice is fantastic.
[Fisher's exact test](http://en.wikipedia.org/wiki/Fisher's_exact_test)
If we want to predict longevity as a function of body weight, using a GLM, we know that the conclusion should not be affected whether we weigh the subject in kg or lb; if you use a simple uniform prior over the weights you might get different outcome depending on the units of measurement.
What is "best" or "appropriate" will depend on why you want a representative data segment at all.  If you could clarify that in your mind the answer might flow easily from that.  I suspect your intuition of the median is likely to be right but a good idea to check against your purpose.
The domain is marketing. I am analyzing TV advertising's impact on lead generation.
Note that if you ever need to do out-of-sample (external) validation, the `rcorr.cens` function in the R `Hmisc` package provides the standard error of Somers' $D_{xy}$ which gives rise to a confidence interval that can be translated to an interval for $c$.  But for internal validation we don't at present have a standard error for $D_{xy}$.
From the question, I'm going to assume that you understand the Poisson distribution & Pois reg, and what a plot of residuals vs fitted values tells you (update if that's wrong), thus you are just wondering about the odd appearance of the points in the plot. B/c this is homework, we don't quite answer as our general policy, but provide hints. I notice that you have a *lot* of covariates, I wonder if you have 1 continuous & many binary covariates.
Thanks @gui11aume for your help. ;)
I don't think the OP's formulas are correct.
You seem to be confounding a process with its [increments](http://www.encyclopediaofmath.org/index.php/Stochastic_process_with_stationary_increments).  The linear trend is *not* stationary but its first increment is.  In your second example, the variance of the first increment is *not* proportional to the time interval: $\\text{Var}[(a + \\sqrt{t}\\epsilon_t) - (a + \\sqrt{s}\\epsilon_s)]$ = $\\text{Var}[\\sqrt{t}\\epsilon_t - \\sqrt{s}\\epsilon_s]$ = $t+s$ (assuming $t$ and $s$ nonnegative, of course).  It depends on *both* the start and stop times.  Obviously that's not stationary.
I totally agree that it can be solved on a higher level. I want to get the best data for this level. As an example, my classifier could output: `l` (48%), `I` (47%), `1` (5%). And the higher level would have a better chance at getting it right.
There are many competing ways of expressing Inverse distributions. Accordingly, if you fail to provide the functional forms you are using, there is nothing 'clear' about the above. The definition I use is that if $X$~$Gamma(a,b)$ with pdf $$f(x) = \\frac{x^{a-1} e^{-\\frac{x}{b}}}{b^a \\Gamma (a)}$$ then $1/X$ ~ $InverseGamma(a,b)$.
@Scott maybe make a post on stackoverflow along the lines of: who can help me parse this block of fortran code into a mathematical formula?
It is very common for overfitted models to be singular (e.g., variances collapse to zero, correlations collapse to +/- 1): http://rpubs.com/bbolker/6226 shows some simple examples.  If you don't like this behaviour you can regularize the model by adding priors, with the `blme` package ...
By not having more resolution for the age variable, you may run the risk of having outcome heterogeneity within age bins, not to mention discontinuities in predicted values.
I have just two points. 1. Your own answer and comment don't seem consistent (e.g. mention of ARIMA in the answer, denial that this is a time series in the comment), so your advice appears contradictory; perhaps this is just misunderstanding. 2. The original poster left unclear precisely how the data were generated, which remains problematic as the different recipes for analysis suggested do indicate.
The p-value is defined as the probability of a result _at least as extreme_ as the observed results ($c$, in your notation) and should therefore be $P_{H_0}(Z\\geq c)=1-P_{H_0}(Z< c)=1-P_{H_0}(Z\\leq c-1)$. Your error lies in defining the p-value as the probability of a _more extreme_ result than what was observed.
Even when the scales are commensurate, this often does not work anyway.  A counterexample is shown at http://stats.stackexchange.com/a/14528: there, the variable $y_8$ has the second highest absolute coefficient (out of $10$ variables) but is not part of a good selection of $5$ of those variables (and is unlikely to be part of the $5$ best).
See [Wikipedia article 'Statistical power'](http://en.wikipedia.org/wiki/Statistical_power)
Sorry for the delay in responding. Is that 50Hz per channel? Can you describe the error further? Is this primarily vibration/thermal-noise error or are you concerned about drift in an estimate of position, say, due to nonidealities in numerical double integration? What are your frequencies of interest? What is your dynamic range, e.g., in LSBs? What is your error standard deviation?
In linear regression, "mean shifting" should not affect correlation
@forecasterThe model identifcation strategy revolving around using the AIC has in my opinion a number of failures. The first failure is that if the series contains Pulses/Level Shifts/Seasonal PUlses or Local Time Trends these will obfuscate correct ARIMA identification via AIC. The second flaw in my opinion is the presumption that ALL of the data should be used indiscriminately to identify and estimate the model.This data set is a "poster boy" illustrating the second flaw.Additionally if the variance of the errors is not-constant then this needs rectification. This can also cause AIC failure!
Do you have a particular language in mind? Python, Matlab, R? What are your programming skills? Because this is mostly some basic signal processing stuff (i.e., computing acceleration, velocity, etc.) so that you don't necessarily need a complete SDK.
(+1) Some comments: First, "three copies" is a particular application, not a general rule.  Second, I believe the DF calculation is just as simple: the amount of data remain the same and one subtracts the number of parameters used in fitting the spline.
By all means estimate ARMA & GARCH parameters jointly - should be more accurate. My point was - fit both a plain GARCH & an ARMA-GARCH & compare the models. I'd suspect, from the plots, that the plain GARCH would be adequate.
Well, it sort of depends on what you need it to do -- they're directly a measure of squared deviation from independence; for a given set of margins they get bigger the more the variables become associated -- the difficulty is they're hard to compare *across* different variables. In the 2x2 table, by comparison, $\\phi$ is directly a correlation.
I've updated my post. The key point is that quantities like mean, variance, etc -- and hence stderr -- can be found for _any_ distribution. But to make probability statements you need to know something about the distribution, be it normal, binomial or whatever. So the stderr can always be found, but how useful it is depends on the situation.
That’s a terrible way to write a bibliography.

I suggest *An Essay towards solving a Problem in the Doctrine of Chances*, Philosophical Transactions of the Royal Society of London, Thomas Bayes, 1763. But **read it**.
Thank you @gung! I guess my question has to do with both... I tried to clarify the problem by editing my post!
Good example Andy - I've learned something new today :)
I would recommend switching from powerpoint to use auto generated presentations using Rmd and pandoc. Also selecting your data automatically from a database (as you suggest you already do) would greatly streamline your process. Once the data change or if you would like to followup a few weeks after all you have to do it rerun the script.
PPV and NPV are both sensitive (i.e. *change*) with different true prevalence of the thing being tested for. PPV gets miniscule rapidly as prevalence decreases (i.e. positives from a test with extremely high sensitivity and specificity are still likely to be false). So asking to compare PPV and NPV requires the addition of a prevalence for the comparison.
I also agree, I think Bayes Factors are best used for issues of model structure, such as whether to use normal or t distribution for example.  They are not useless for covariate selection, but inefficient compared to shrinkage.
I like Statistical Computing with R as a very applied example based book.  Highly recommended.
It's not a solution but it is an answer. Thanks :)
It is very important to add that in this context one should _not_ take those F (or p) values as indicators of statistical significance (i.e. relative the population), but rather simply as indicators of magnitude of the differences.
Thanks for your answer about proportion type variable anyway :)
You need to provide the details of your problem.
@mt0: your statement in the first paragraph "The maximum number of principal component is always D" is incorrect. If N<D, then you can only estimate N-1 PCs: imagine 2 points in R^10 -- here you can only get 1 PC. The rest of your answer seems to be correct though, so I am just nitpicking.
H2 x H2 was a mistake. I meant the cross function of any $H_i \\times H_j$. This will allow the regression or SVM to come up with a combination weight for two heuristics together.

So just to clarify your other comment, does it mean a couple of robots can not work at the same time. Meaning only one robot gets 100% of the power at a given time?
I realize I need some sort of model for the relationship between (pi,1,pi,2,pi,3). What I was trying to get at with the question was, if you have such a model, how do you fit the parameters? Are there standard algorithms, or R functions, etc, to fit them, for example. I'll expand on the question, to clarify.
Hmmm, so what would be the correct equation for $p(x \\mid y)$ that has a $p(x)$ or $p(y)$ term in it? $p(x, y, \\epsilon) = 1$ iff $x + y = \\epsilon$, right? I'm not seeing how it's helpful?
That's pretty broad, it could refer to a huge variety of models - various kinds of regression, multilevel models, trees and their variants, clustering.... etc.
Here is a link to the follow up question  [link] (http://stats.stackexchange.com/questions/63530/problem-with-bootcv-for-coxph-in-pec-after-feature-selection-with-glmnet-lasso)
Don't forget to vote on helpful answers (you now have enough rep).
Yes, that's the analysis that's used. I saw 'Friston, 2005' on one of the slides accompanying the article.
Thanks @chl.
I've edited your question to clarify.
Added to the answer upon your request
Thanks StasK, I think I was a bit on the right track but had not practical experience for this project.
Well I am sure this isn't the best solution, but I have now managed to get this work using an version (of the optimiser?) of Stata. This was an accidental find because I happen to have an old version of Stata running on a different machine. It doesn't make a lot of sense to me. `version 10: fracpoly: logistic y x` (_NB: This was originally posted as an answer but moved to comments as per Nick Cox's suggestion._)
I am not an expert on time series, but off-hand I'd say "no". The size of $\\delta I$ could be small and yet it could have a large effect on taxes.
@whuber Wow I completely missed that; I edited the post and left what should still be relevant for $R_{a}^2$. Thank you.
Related: [Recommendation for peer-reviewed open-source journal?](http://stats.stackexchange.com/q/28117/2970)
+1 Thank you for the nice illustration!
@cardinal - but then you have to pay attention to the order of operations in whatever loop(s) you set up!
I second that.  There's a lot of little gems in this book.
Alot of companies run on things of interest that don't necessarily have a complicated statistical element. Like average purchase price, average items purchased, average time between purchases, creating a scorecard of these metrics can sometimes be more interesting to business people than any statistical segmentation.
What is $D(0,1)$? Space of [càdlàg](http://en.wikipedia.org/wiki/Cadlag) functions?
Have you tried e-mailing original authors? Paper is quite old, but it is always a good idea to try.
Please, post a summary of the constraints you considered or paste your path diagram. We don't necessarily want to watch a Youtube vid :)