tttjjj/elt_bench huggingface dataset:
Why does one need to hold a separate copy for cross validation? As far as I know cross validation is done using training data, it is a waste to save separate copy only for this purpose.
Especially where students are concerned.
Hi,
Starting from my simple model:LWAGE=B0+B1*EXPER+residuals
I insert in my model the variable EXPERSQ (=EXPER squared):
LWAGE=B0+B1*EXPER+B2*EXPERSQ+residuals
It would make sense to plot the quadratic fit on the plot (LWAGE and EXPER) something like:
lines(exper, predict(lmod2), col=3) where lmod2 is the quadratic model. But this R script doesn't work.
I need to consider the linear and quadratic terms together.What I want to do is predict using the quadratic model and then overlay the fitted line in the original plot, and see how close that comes to the red line. How can I do that with R?
That's exactly it. I am trying to model this problem, but I couldn't come up with a solution.
The discussion culminating in the paragraph preceding section 2.2 appears to address your question.
This is essentially the same issue as here: [significance-of-coefficients-in-linear-regression-significant-t-test-vs-non-significant-F-statistic](http://stats.stackexchange.com/questions/24720/). You should read that & see if you have any lingering questions left over. If so, edit this Q to specify clearly what you still need to know; if not, this Q should be closed. You could flag a moderator for attention to help w/ that.
Aren't you actually fitting $y=\\alpha r^\\gamma \\mathbf{+} \\epsilon$?
Surely only the observations present in both lists simultaneously tell you anything about the correlation, unless the missingness is somehow associated with size itself. Is this missingness *at random*? *Completely at random*? Something else?
+1 Solid advice.
What are Dv, Iv? Are those variable names?
A great review of goodness-of-fit tests was published in 1974 by M. A. Stephens in JASA, [EDF statistics for goodness of fit and some comparisons](http://www.math.utah.edu/~morris/Courses/6010/p1/writeup/ks.pdf).  It is still well worth reading as an introduction to the subject, for its survey of effective tests, and for its power studies.
Hi Javlacalle, thank you very much for your help. May I ask if there is any condition for the time series or this can apply for any? Could you explain a bit about these command lines?
tmp <- which(fit$model$Z == 1)
id <- ifelse (length(tmp) == 1, tmp[1], tmp[2])
@Mike: You need to concentrate the idea of "the window".  In the above case, "the window" is 1 day.  And for trading purposes, you would react each day to the previous day.   The full graph above is 180 days.   However, if you want to use 180 days as "the window" then the total number of trades in the previous 180 days would be your "cluster number" (in this case, there were a total of 404 trades in those 180 days, giving you a cluster number of 404).  This 180-day window would advance each day, dropping off the trades that are 181 days ago and picking up the latest trades.
From that I gather that you could estimate both the probability of any accident and the mean number of accidents, among other quantities.  The Poisson distribution may come into play.
Chi-square can be done with more than two variables; but it's not clear that that is what you want. Is one of your variables (or more than one) a dependent variable? (That is, something you are trying to predict)?
... correlated with the $\\theta$'s that they're a pain to infer. But if I can get a rough idea of their distribution from a burn-in period I can (maybe) use that to develop a proposal for an independence metropolis scheme to update $\\theta$ in a great big block - the order restrictions on $\\theta$ induces a lot of autocorrelation in my chain and that should help break it.
@cabita you are welcome. I am not sure, but I guess if you have all the interactions you can, as long as there are repetitions (more than one plot per treatment). Is this related to your question [here](http://stats.stackexchange.com/questions/105890/difference-between-a-random-design-with-factorial-arrangement-and-a-factorial-mu)? If it is, maybe you can clarify it a little bit (I wrote some tips for you there, see if they help).
Your models are not nested, what would be the rationale for using an LRT between the two?
+1.  There are other papers, but I'm not sure they're necessarily better; I think Chalise does a pretty good job summing up the situation.
Pah! @Tal, Did you know that cross-posting a question is strongly disapproved? ;)
You seem to have a problem of comparing two groups! What about a Wilcoxon two-grouo test? (groups defined by the binary variable)
Since you consider 0.065 not to be statistically significant, then *above all else* you need to explain that you performed a test that *fails to reject the null hypothesis.* Every thing else is secondary to that salient fact. (I am very concerned that many of the suggestions made in the answers could be read as ways to hide or obscure this main point. Such actions potentially run afoul of [professional ethical guidelines](http://www.amstat.org/about/ethicalguidelines.cfm#eguidelines).)
@whuber I think it's at least broadly clear enough to hazard a first attempt at an answer which might be improved. I answered in the hopes that it would help the questioner identify their question more clearly, or so that they could explain that I had misunderstood what they wanted. In this case, at least, I'd rather give some response to what I believe is a genuine question than leave the OP with nothing on which to try to improve the question. I have an idea for improving my answer, which I hope to get to today.
Don't confuse *true* $\\tau_i$ with the *estimated* $\\hat\\tau_i$. If the true $\\tau_i$ can be assumed the same from day to day, then you're fine. Else, the more they vary, the more optimistic your interval is. (By this I mean the interval is too narrow.)
Welcome to the site, @EhabElharty. I cannot understand your question. Can you edit it to clarify the English?
How long are your time series?
@jbowman: just the first equation, using simple OLS regression.
Call $\\hat{\\beta}, \\sigma^{2}$ your estimated slope and error variance from the regression. Then your estimators are $Y_{m} = 11 \\hat{\\beta}$ and $Y_{s}$ is, as you said, the sample mean of all $y$'s with $x = 11$. We know ${\\rm var}(Y_{m} - Y_{s}) = {\\rm var}(Y_{m}) + {\\rm var}(Y_{s}) - 2{\\rm cov}(Y_{m},Y_{s})$. The two variances are simple to calculate: ${\\rm var}(Y_{m}) = 121 {\\rm se}(\\hat{\\beta})^{2} + \\sigma^{2}$, which should be available from the regression output. ${\\rm var}(Y_{s})$ is just the variance of a sample mean. The ${\\rm cov}(Y_{m},Y_{s})$ term is rather puzzling though ...
Readers here might also be interested in reading the following thread: [correlation-between-dichotomous-and-continuous-variable](http://stats.stackexchange.com/questions/25229/).
Hi, you may want to look at this http://doingbayesiandataanalysis.blogspot.com.au/2012/11/shrinkage-in-multi-level-hierarchical.html and this http://stats.stackexchange.com/questions/28099/bayesian-mixed-model-regression-with-a-between-subjects-factor to get you started, and before somebody comes along to give you a fuller answer.
I did an LRT on the 4 terms and this was significant, so my concern is resolved, but I'm still curious about the general problem.  It seems that we include all lower order terms/main effects when fitting interactions and polynomials to avoid forcing the function through the origin, or another unnatural 0.  When we fit a quadratic function and only a linear interaction, it forces an unnatural point where all the curves will cross.  So while there might not be theoretical problems with this interaction, is it reasonable to discount it due to what it means within the problem?
Chapter 17 covers:
17 An overview of the GLM
17.1 linearity and the GLM
17.2 bivariate to multivariate statistics and overview
17.2.1 bivariate form
17.2.2 simple multivariate form
17.2.3 full multivariate form
17.3 Alternative research strategies

I hope this can help
Regards
(Vaguely) related: http://stats.stackexchange.com/questions/12174/time-taken-to-hit-a-pattern-of-heads-and-tails-in-a-series-of-coin-tosses
+1 That's some hint. Do you know if they just skip to the next word, or do they just stop there?
Sarah - where you said "*if two explantory variables are correlated that they necessarily explain the same particulars of variation in the dependent variable*", it looks as if the response by @whuber is actually dealing with "they explain the variation in the response" when you're really saying "they explain the **same part** of the variation in the response". If they're perfectly correlated, it's necessarily the case that they explain the same part of the variation. (If they're only very highly correlated, generally the second adds little over the first.)
If you look at the properties of the variance of sums of random variables it might help you on your question, http://en.wikipedia.org/wiki/Variance#Properties (as well as say why your calculation does not sum to unity).
@Dimitriy: But note that $Q = 0$ *is* positive semidefinite and symmetric! Note also that if $Q$ were zero along the diagonal, then automatically all off-diagonal elements would also have to be zero. :-)
It's certainly true that the distribution of a fair die is a discrete uniform, & that a specific die can be tested against this "particular theoretical distribution" for fairness. But $\\chi^2$ *goodness of fit* tests can also be conducted against other (non-uniform) theoretical distributions, & the $\\chi^2$ *test of independence* (which you would be using) certainly does not require this.
As for measures of association, there are a number of ordinal-ordinal measures; one example is [tau-b](http://en.wikipedia.org/wiki/Kendall_tau_rank_correlation_coefficient#Tau-b)
@Alecos I think I have a better understanding of the substance of the question now: given two marginal distributions, there is an infinite set of possible joint distributions. In what circumstances does imposing the condition of zero covariance leave us with only one of those joint distributions still possible, viz the one in which the random variables are independent?
...so, `.325-(.172^2+.174^2+.465^2+.164^2)=.022` is the shared portion of explained variation in Y. No it isn't negative and cannot be negative.
Hi, @Glen_b. I'm trying to do things the right way, but it seems it is hard. Sorry! Thank you for the tips and patiente.
@Pacomet - you can update your question with additional details, there shouldn't be any time restriction on that.
"quantify the purple area" is a problem in estimation, not in hypothesis testing, so you cannot hope to "accomplish this using a standard citable statistical ***test***". You contradict yourself. Please clarify what you *actually* want. If all you want is an estimate of the area of overlap of two KDEs, that's a simple calculation.
It's been "ln" for just about 100 years. Can you think of one good reason for writing "Ln" instead? In any paper I was reviewing or editing I would always recommend "ln". What next, "Exp", "SIN"?
@ahfoss Time component can be incorporated in a classification scheme. In the question's setup you can measure time between events (any event or specific ones); number of events per some unit of time; time from first occurrence of event X from start of customer history; time until first complain in customer life-time, etc.
Your last sentence - brilliant!
This isn't an answer to your actual question so I'll give it as a comment.  My starting point would be a plot the continuous explanatory variable on the horizontal axis and the response on the vertical, with different color points or lines (if modelled) for each value of the dichotomous variable, and a different facet/trellis/lattice for each value of the three category variable.
+1, this is the right advice. I would think you could use a nested model test, however. The AIC is helpful, but I primarily use it to adjudicate between models w/ different variables that are not nested.
It looks as if you are supposed to assume this is a continuous variable, but in practice absentee records tend to be discrete: which group would someone absent for 6 days be in?
@whuber All of your assumptions are correct. To answer your questions: I don't know. I don't know how the uncertainties are generated in the first place. I don't know what the physical size of the detector elements are with respect to their spacing.

I'll see what I can find out.
Here it goes a suggestion to improve your answer: post a [reproducible code](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to build this type of graph and then, maybe, upload the output graph/picture (to show exactly ywhat you were looking for).
I am not very familiar with ggplot2. Thank you for the suggestion.
Thank you. I think I understand.
Some keywords like "dimension reduction", "subset selection", could be helpful to look through here, before throwing question ... and still I am not sure if I get your second question properly ...
Could you say more about what the actual dependent variable is here?
As a side comment you would have had to reduce features to 10-30 not using $Y$ for your approach to work.  Stepwise feature selection without penalization has been proven to perform badly.  Penalized maximum likelihood estimation (e.g., L2 shrinkage) intentionally underfits the data at hand so that there is no overfitting of future validation data. Well-fitting the initial dataset can be a bad idea.  Consider 9 features on 100 subjects yielding an $R^2$ of 0.4.  Randomly removing 90 subjects and refitting will result in an $R^2$ of 1.0 on the training data but near 0.0 on new data.
I'm having trouble understanding your question. Are you asking if it's acceptable to set your alpha level for significance at <99%, as long as you do this beforehand?
If `Cproduct` is supposed to be `C1 * C2 * C3`, then check your arithmetic: in condition 2 to product should be 0.
@RockScience So are you wanting an answer to the question: If the outcome of a set of significance tests are correlated, what is the probability of making one or more Type I errors if the null hypothesis is true for all tests?
Bear in mind that the AIC is also a random variable & is not magic. You could estimate its sampling distribution w/ bootstrapping, if you wanted, although people don't. AICs that are very close (eg, 100 & 102) typically might as well be considered equivalent.
Are $X$ and $Y$ independent?
Ha, thanks! It's much appreciated. I won't mark as accepted just yet, let's see what other people say...
Your clarification is fine, but it doesn't change anything in what I wrote. "Rating" is a form of test, I think (although not a traditional paper and pencil test).
@fgnu, sorry I am not following...
This is correct, but how would you know if it was orthogonal unless you had a truly random sample?
this question was asked on [SO](http://stackoverflow.com/questions/5681630/market-mix-modeling-with-r). Coincidentally, the book referenced [there](http://www.amazon.com/gp/search/ref=sr_nr_n_0?rh=n%3A283155%2Ck%3Amarket+mix+modeling%2Cn%3A!1000%2Cn%3A3&bbn=1000&keywords=market+mix+modeling&ie=UTF8&qid=1302897164&rnid=1000) is still applicable here.
Why not regress 0 on $1, X_1, \\ldots, X_{11}, Y_1, \\ldots, Y_4$?  The difference $a_0 - b_0$ will not be identifiable, but in retrospect that's obvious.  And of course you cannot obtain an $R^2$ for either of your models, because you have absolutely no information about the variation of $Z$; however, the $R^2$ for the regression involving all $X$ and $Y$ together is informative: it tells you how closely the two models can typically be made to agree (although the MSE is much more useful in that regard).
You have misunderstood the question. I am looking for the distribution of $X_{i_j}$ as a function of $j, n, \\sigma_x, \\sigma_y$. I do not actually observe the $X_i$ and $Y_i$, and cannot condition on them. One may assume, w.l.o.g. that $\\sigma_x = 1$, and thus consider only the parameters $j, n, \\sigma_y$.
hmmm, could you print those results with fewer sig figs? I cannot parse them easily...
You probably haven't found a clear answer as to what you *should* do because there isn't one that doesn't depend on what you *want* to do. If you want to control the chance of one or more Type I errors over all tests, then correct for multiple comparisons; if not, don't.
(+1) Related to what chl says, the value of $\\rho$ they request allows one to interpret the output of the power analysis as "If the true correlation is $\\rho$ and the sample size is $n$, then we you have a power of ______ using this hypothesis test". It's the measure of effect size in this hypothesis test. Similar to how the mean difference and the standard deviations produce a measure of effect tests in two-sample $t$-tests. Also, your point about being cautious with post-hoc power analysis is important - lots of problems with that.
There may not be any problem even if you see values out of the mentioned "range". For example, we may have some estimators that don't preserve the range of original parameter and will give us some estimations that are out of the range. This does not contradict the definition of range. Also, the "CI" and "Range" are completely two different terms. I doubt many use "CI" as range, even if they do, they are wrong!
@BlainWaan, thanks! I will study up on SARIMA then. Are there other potential candidates that you might suggest?
Interesting data, but I couldn't understand what is going and what is problem.
I suppose it is, the GPower reference does claim that "Cohen’s(1988) effectsize g is used and exact power values based on the binomial distribution are calculated".  I suppose I was just holding out hope for actual equations.
Also, it would be helpful to clarify whether instead of "parameters" we should read "estimators of parameters" (in a frequentist approach), or whether we are in a Bayesian framework.
I notice that you have voted only once & none of your questions have accepted answers. Is it true that none of your questions have been sufficiently answered for your needs? If some answers have resolved your issue, would you mind accepting them by clicking the check mark below the vote total to its left? In addition, if you feel some of the answers have been helpful, even if they didn't quite resolve your question, you might consider upvoting them. These actions act as a 'thank you' for people's efforts & are critical to the site's functioning.
If the variance explained by a random effect is extremely small in comparison to the residual variance, that should definitely investigated.
Thanks. I will try and redo it!
That is correct.  Risk = probability, rate = slope or first derivative of something.
@KTwildginger I am assuming you are worried about multiple comparison issues. I am going to say I don't know. Although, I am pretty sure you can get at all the contrasts using an appropriate Wald test and hence using one application of the Delta method, so multiple comparison issues should not apply.
Hi Glen_b, thanks for the detailed reply! :)
Again, thanks for taking the time, best wishes to Australia.
You seem to use "exist" in the sense of "has a conventional closed-form expression." ("Exist" in math and stats usually means that it has a well-defined value, whether or not that value can easily be written.) This raises the question of what you mean by "compute": are you looking for a closed-form expression, or would alternatives (such as a power series, and algorithm, or a numerical approximation) be acceptable?
I don't think this is right. The $p$-value for testing $H_0 : p > .3$ is the area to the **right** of the observed test statistic. Therefore, we need to know the sign of the test statistic (i.e. we need to know whether or not the observed proportion was $>.3$) to calculate the $p$-value John seeks - it could be either $.005$ or $.995$, and there isn't enough information in the problem statement to say which.
I made several edits to my answer.
@ Zach: Thanks. The null of the Wilcoxon signed-rank test  (unless I'm mistaken) is that the median of the two ranks is equal. This allows to test overall differences in rank order (when the two conditions are ranked together).
What I need is a test that will compare whether the order itself changes.  I.e., I want to see if the rank order 1 2 3 4 5 6 7 8 9 10 is different from the rank order 1 3 4 5 2 8 9 6 7 10
Very interested to hear others opinions. I don't think you'll necessarily end up with a great increase in the "efficiency" of the experiment in terms of participants recruited (which would end up with a part-way number between a fully-between and a fully-within design) to get the same amount of power/estimation accuracy -- Factor A will have more estimation accuracy in half the group, Factor B in the other half. The analysis for this might be excruciatingly complex, too -- perhaps some form of mixed (linear?) model, but I can't think how this would work exactly.
I don't know enough to be comfortable with saying it is "impossible", but I would be surprised if I saw R Squared decrease and I would certainly investigate when that happend (e.g. are missing values treated in exactly the same way in both models).
You could combine these into `=if(countif(a1:a20,"NO")=0,"YES","NO")`
+1 for Maxwell & Delaney!
+1. However, claim that K-means isn't a clustering seems to be too radical, too "data-mining" viewpoint. Historically K-means is classic partinioning cluster analysis. The fact that it happily partitions "unstructured" data does not exclude it from the domain of clustering: many types of analyses can be, so to speak, misused and give silly results.
Of course. I also changed `eps` and `Eps` to `epsilon`. Thanks!
@Kerry glad you found it.
Here's a question: what is the effect if you take logs and they're not called for? I've liked it when working with time series that require a log transform, because (as I understand it) the coefficients are ratios and at small values nearly percentages. (E.g. exp (0.05) = 1.051.)
I didn't expect it to be. It is mentioned by people on many places so I just accepted it. Now that I have been thinking about it is why I wanted to prove it. I like you're answer let me play around with your info a bit to see what I can conclude.
They clearly have repeated measures. How does that play into the matching approach?
It seems to me this question is more suitable for [stats.se].
**Hint**: If the mgf exists in an *interval* around zero, say $(-t_0,t_0)$ for some $t_0 > 0$, then consider the Taylor expansion of $e^x$ and monotonicity of the integral to discover the solution. :)
Does SE publicize referral information? I'd be interested to know the viewing pattern of posts rather than just upvotes, comments, etc.
It isn't really possible to give a good answer to this question without knowing more about the particular problem.  The key question is whether the exact zeros and ones are generated by a different process to that which generates the data in (0,1).  A classic example is rainfall, where there are exact zeros reflecting days where it doesn't rain.  In your application are zeros and ones "special" in some way?
Your questions bely a fundamental lack of knowledge of what PCA does. I *strongly* recommend you read the following article. If you feel comfortable with linear algebra and basic statistics, you can skip to page 13. The meat of the discussion is only 7 pages with graphics, and is the most accessible explanation of PCA I've encountered: http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf . I also suggest you avoid the temptation to use tools you don't understand in general, since you probably won't interpret their output correctly.