tttjjj/elt_bench huggingface dataset:
It really comes down to (i) what population quantity you're estimating, (ii) what estimator you're using for it, and (iii) the properties of that estimator (which in most cases differs from distribution to distribution). In many cases there will be a formula somewhat like the one you have (many estimators will be asymptotically normal with some standard error, for example), but different in detail.
There are many ways to generate random variates. Some of them capitalize on mathematical relationships determined by formulas for the distribution functions. Others only need a list of data such as you used to draw that fitted curve. If you have a formula for the distribution function, consider quoting it so that readers can determine whether it will be useful for your purpose.
@Manuel  Sure, the _Handbook of Econometrics_, volume 5, chapter 59 is all about this stuff.
@whuber hmmm... with $y_i$'s deterministic, the process $y_iX_i$ is no longer ergodic (or stationary). So "time averages" of moments do not coincide with "ensemble moments". So it appears my answer is tailored (and constrained) by its own assumptions.
Thank you for the suggestion.  I've tried adding dummy data points at the fixed coordinates, and K-means does seem to latching on to them.  I'd still be interested in knowing if there's a way to directly specify cluster centers with mclust, but this is a good workaround.  Thanks!
Various terms have been suggested by supposed analogy with  "dichotomous" for classifications with more than two categories. "Polytomous" is preferable linguistically to "polychotomous", which is based on an incorrect guess that "dichotomous" parses into two Greek roots, "di" and "chotomous". "Multichotomous" compounds that error with use of a Latin root. Although words with separate Latin and Greek roots have survived the disdain of linguists (e.g. "television") I advise the use of "polytomous" here.
How many observation for each combination of age/sex/cohort you have? I assume it's not too much, right?
+1 for your follow-up. @Dbr Please remember advices that were given to you on SO too: a reproducible example is far better than a public link to a Stata datafile that will likely be dead in few weeks.
thanks for the hint
Okay, I think I now get where the point of my confusion was. I was under impression that the expression sums over the observations in the sample, rather than different values of $X_i$ you could obtain. In that case, it would be perfectly acceptable to use $\\lambda$ for expectation. Provided that we indeed sum over the counts of values $X_i$ could obtain, and not the $X_i$s themselves, Binomial makes much more sense then. Thanks!
Charles, I'm sure there's no such syntactic limitation. Even if there were, writing $a \\frac{K+0.6b}{T+b}$ as $a\\left(0.6 + \\frac{K - 0.6T}{T+b}\\right)$ would work around it.
Unfortunately the two data sets have different variance. Is there a version that can account for that?
Yep, I got it from my library once but had to return it before I got a chance to read it.  I will give it a look again, thanks.
Are you referring to a particular software package? In general, PCA is not the same as Factor Analysis, but in SPSS you access both from the same menu, and it's the "method" that allows you to select which one (amongst other features).
Thank you Dwin.  I wonder which of the different residuals should be explored (besides the Within one).  Cheers, Tal
NOORIGIN subcommand in her code tells that intercept was included in the model
I think that your pretend example doesn't match your real case. 

In the pretend example, if you want to show that people of a given age are about the same height, you can just report the variance of height for that age. But if you'd like to show that ALL the people of a given age are about the same height, I'd report the range of values. 

But then you start talking about measures that combine the variances or something across different groups. So apparently you want to say something not about people of a particular age, but about people of different ages.  But what do you want to show?
There are some on p47 onwards of [Common Errors in Statistics (and How to Avoid Them) by Phillip Good, & James Hardin](http://books.google.co.uk/books?id=znnQTh4iXOQC)
Thank you! You may suggest other ways to create big sample with properties experimental sample?
It wouldn't be outrageous to calculate the correlation between observed and predicted responses and square it. It's just that for regressions without constants that is not the same result as usually reported for $R^2$ in statistical software.
This seems to me like a mish-mash of partly correct & partly incorrect understandings (it reminds me of many students, alas). Concepts in frequentist inference are just really *hard* and counter- / un-intuitive. Of course, you are familiar w/ this thread: [Why does a  95% CI not imply a 95% chance of containing the mean?](http://stats.stackexchange.com/questions/26450/).
@DimitriyV.Masterov. Yeah I am sure. How come you got 0.0046 abd 0.0030. I am using matlab. Are u using matlab?
The first sentence is really on the point. Frank Harrell mentioned in a comment on this site something like $n>10,000$ to get stable results, if I remember correctly. The variable importance measures are often used for feature selection in wrapper or embedded methods, though. Maybe you want to elaborate on where difficulties with interpretation arise?
[Cleveland and McGill \\(1985\\)](http://www.sciencemag.org/content/229/4716/828.abstract) discuss this issue (p831) "*... the difficulty of detecting vertical distances between curves*" but don't explicitly name it. [This](http://www.sciencemag.org/content/229/4716/828.abstract) blogpost calls it the "tilted baseline problem".
You might be interested in the thoughts at http://stats.stackexchange.com/questions/8371/do-confidence-intervals-apply-to-quota-sampling, David.
Chi square seems poorly disposed to handling varying numbers of categories within a single test.  Could you be more clear about the test you are performing?  Chisquare goodness of fit?  Independence?  How are you handling the varying number of categories?
@mbq: many thx for editing my question :)
http://www.ats.ucla.edu/stat/sas/library/repeated_ut.htm
Great. Thanks a bunch! I really appreciate it :)
+1. Josh, that's a pretty complete reference sample -- thanks!
take the log of your data and use least squares (=logNormal) ?
If X and Y are independent, Var(X+Y) = Var(X) + Var(Y). The variance is more complicated for a non-linear relationship, e.g., Var(XY). Using the first terms of the Taylor Series expansion of something like XY gives a linear function that is assumed to be a reasonable approximation in the region of interest. There is no guarantee that this is true and the GUM discusses the use of a second order Taylor Series approximation.
Also:  http://cdn.memegenerator.net/instances/400x/37929308.jpg
(ctd) ... (iv) if the conditional distribution on the log scale is approximately normal you can estimate the mean on the original untransformed scale pretty well by an adjustment (multiply by $\\exp(\\frac{_1}{^2}\\hat{\\sigma}^2)$), but if you're interested in the ratio, the adjustment term cancels out (that is, a ratio of means will be the same as a ratio of medians). Even if it's only close to normal, you can derive a similar term as an expansion which will also cancel; (v) if you are prepared to make some other parametric assumption, you may be able to derive what you need. Lots of options...
Could you elaborate on how to use copulas? I've checked the documentation, but it seems that the correlated vectors are drawn from a uniform(0,1) distribution. I don't see how that would work with the distributions I specified earlier.
I would suggest you check out the visualization tag over at the gis stack exchange site for examples http://gis.stackexchange.com/questions/tagged/visualisation
But the log-linear model would test whether contidtional homogeneity is to be rejected, doesn't it?
Ah, that's right! That's little-known PyMC thing. Thanks for bringing that back to my attention. Personally, I've moved away from Bayesian survival analysis for three reasons: i) computational difficulties - this post goes into them, and it can get worse. ii)  I rarely need a point-estimate distribution when I perform survival analysis - I'm mostly interested in kaplan-meier curves. iii) I like the non-parametric nature of kaplan-meier estimates, and the semi-parametric form of Aalens. Bayesian SA requires a few too many strong assumptions.
Stephan, thanks for your input.
I think that is what I am trying to say:  that logistic regression belongs to GLMs, rather than GLMs belonging to logistic regression.

Just because SAS has those options for its proc logistic does not mean that it is logistic regression.
According to the observation by @Procrastinator, here is a working, correct `R` implementation of a uniform variable supported on $[a,b)$ (not just $(a,b)$): `function(n, min=0, ...) {t <- runif(n, min=min, ...); if(FALSE) min else t}` :-).
Define how $M$ "follows" $X$ or $Y$ here. Is your "success" (and its probability) the correct prediction of $M_i$ conditional upon $X_i$, $Y_i$ or the mean squared error of such predictions or...?
Welcome to the site, @RamKotes. This is just a reiteration of your homework problem. What have you done so far, & where are you stuck?
@chl - thanks. I really take advantage of the `scales` argument in the facets frequently to display information that is consistent across one axis. For example when reviewing diagnostic plots from CBC HB models, I find it helpful to check convergence by reviewing the percent certainty, RLH, average variance, and parameter RMS values. All of these have different scales on the y-axis, but should converge and flatten out if you include enough iterations in your model run ( x-axis). It's pretty trivial to set up an R script to parse the log files from HB and generate these plots as a pdf or jpeg
See [this blog post](http://jeromyanglim.blogspot.com/2009/09/variable-importance-and-multiple.html) by Jeromy Anglim. A simple alternative (available in SPSS and likely MiniTab) would be the semi-partial correlation. The linked page to [Ulrike Gromping](http://prof.beuth-hochschule.de/groemping/relaimpo/) goes into much detail about various other procedures - see the American Statistician articles.
@Fan, for the set $\\{1,...,m\\}$ the maximum variance I suspect be achieved with the sample $\\{1,2,...,n/2,m-n/2+1,...,m\\}$ with suitable adjustment for odd $n$. The question is how to prove it.
It takes only a *single* infinite case to make the expectation infinite!
What is the question you are trying to answer?
@Max Preferably both :) Intuitively, I see them as equivalent because for most data $k\\ll N$ so $\\displaystyle \\frac{1}{N+k}\\approx\\frac{1}{N}$
No we have the same P and u. But you get x - the structural errors, are found by multiplying P and u, it will be a 3x396 matrix. x[i,t], is the structural shock of variable i at time t.
@whuber - The question is why a linear model fails. It fails because the functional form isn't linear, it's quadratic. I wanted to give the answer simple and to the point. Gung's answer does a good job of going into the details, and shows how you can use the residual plots to come up with a better model. (I just did it on pen and paper.) I agree his answer is more detailed and complete and I have upvoted it.
@B_Miner I have updated my answer.
How about an almost-mnemonic: you can replicate conditions but not subjects, though you can repeat a measurement on the same subject.
@NickCox While it does read awkwardly if you expand out PCA, some sources state it is acceptable to 'duplicate' the last word like that, as with PIN number, ATM machine, HIV virus, ISBN number, LCD display, SAT test. Others say it's a mistake, but I think that itself [is an error](http://english.stackexchange.com/a/14882) -- but even if it isn't, that horse sailed long ago.
http://cran.r-project.org/web/packages/fitdistrplus/fitdistrplus.pdf
Thank you!  Especially for the references.
Jeromy, thanks for improving my title.
That initial probability $n\\Phi(c)$ only applies if the collection of $X_{i}$ are independent of $Y$ and $Z$ - so if that applies, then you are correct.  But you mentioned correlations, so it is likely your initial formula is not applicable.  If you have conditional independence given $Y$ and $Z$, then you would need to modify the constant $c$ in $\\Phi(c)$ so that it is a function of $Y$ and $Z$.
Such a thorough answer! Thank you very much!
You can start by taking a look at this links: http://stats.stackexchange.com/questions/16390/when-to-use-generalized-estimating-equations-vs-mixed-effects-models http://stats.stackexchange.com/questions/32419/difference-between-generalized-linear-models-generalized-linear-mixed-models-i
But there are no tuning parameters for the glm method.
@jbowman: I'm interested in testing under a variety of distributions and intensities. Trying to keep this as general as possible.
Please - can I have empirical answers only - I do not understand most mathematical notation.
And the "strangeness" was not that the intersection point of the curves was unexpected based on the function, but is this an unnatural way to model the problem by forcing the intersection.
I had a quick glance at the Mitchell paper, and so far I don't particularly like it (I think the $n \\ll p$ is in a way a coincidence: even random forests are no magic bullet against too few cases. At some point also their performance breaks down and I guess this is the underlying cause of the reported observations). However, the observations of a pessimistic bias are not astonishing to me, see my answer. Actually I think that the thougts I outline in my answer may offer a conceptually rather simple explanation of what is going on there.
I think you need to rectify your terminology, as currently it makes little sense. This may be a common terminology or approach in your substantive field, but I cannot really follow your request. Please do not comment, but instead edit your post to provide more information. What are the variables? What do you want to analyze? Why do you think you need the coefficient of variation? Give references. My feeling is that if you are measuring whether some things occur together, this is a log-linear analysis of some kind, and it has little to do with coefficients of variation.
It is unclear what you are doing.  What does it mean for a vector to "contain ... samples" and, when $a$, $b$, $c$, and $d$ are vectors *of different lengths,* what do their products mean?  In any event, whatever you are doing looks like it might possibly be answered at http://stats.stackexchange.com/questions/51699, which shows how to compute moments of inner products of multinormally distributed variates.  (Yes, I read the `R` code, but it's still unclear what you're trying to do, because it seems to be evaluating *standard deviations* of *components* of vectors, not variances at all.)
@chi The effect of A was expected, while the effects of B and A*B were both main hypotheses. And I am going to show the effect sizes in a figure. Thank you for reminding me not to make the error of accepting Ho.
Yes, the estimates for the fixed effects in random-effects model and the estimates for the mean model in marginal models coincide, regardless of the random effects structure.
I don't see a question here. Is something not working the way you expect it too?
The Wilcoxon-Mann-Whitney test is sensitive to more general kinds of difference than a straight location shift; for example, with positive values, its equally sensitive to a scale-shift (taking logs converts the scale shift to a location shift, but the WMW statistic is the same). You can even treat a one sided alternative as general as $P(X>Y)>\\frac{1}{2}$ for example (e.g. see Conover's *Practical Nonparametric Statistics*).
+1, this is a nice overview with useful links.
Cutting off data to change the apparent slope is fraudulent.  OTOH, there is a real question about whether axes should always include 0, and (somewhat less related) the aspect ratio used. Cleveland makes a strong case that graphs are more informative if you maximize the data within the data window, and 'bank' slopes to 45 degrees. Know your audience, here: Cleveland argues that professional audiences should be taken as competent and literate, but with naive audiences, either explicitly point these features out and explain them, or (possibly) don't use them.
The fact that "outliers" can damage regression fits doesn't imply that the modeling process is dependent on distributions for $X$.  I think of high leverage points as being damaging as a consequence of most of our model fitting methods not being robust.  To handle heavy right-tailed variables I often fit restricted cubic splines in the cube root of the predictor.
I agree with this in principle but in the case of a small data set (I often have only 20-40 cases) use of a separate evaluation set is not practical. Nested cross-validation can get around this but may lead to pessimistic estimates on small data sets
Thank you for the excellent and enlightening answer! I think I'll pick jbowban's permutation test for my studies because I think I understand it and its limitations better, but the delta method definitely looks like something I need to study and figure out.
@whuber I was thinking more generally there - if the concern is reproducing the exact set of results you will more than likely need the version of R and versions of any packages used. To whit; R 3.0.0 changed the precision with which it reported values - not major but that was enough to throw off all many package check tests that were assuming too much precision. Also, packages are updated regularly and things change.
@Tomas: Perhaps better to say "the qqplot looks as if it could have come from a normal population".  It might instead have come from a distribution with heavier tails.
I am curious: why did you specify the "graphical-model" tag for this question?
Thanks for your quick reply. The relation between the sequence of weeks and my event is a good point.
@mpiktas Almost.  Actually, the rhs is in the form $P \\cdot P^T$ where $P$ is stochastic.  This is needed to make $Q$ positive definite.  Now its maximum eigenvalue usually *exceeds* unity but its second one does not--and is guaranteed to lie between 0 and 1.  $Q$ really *is* a covariance matrix with a constant added to each term.
Er no, your calculation of $E(Y\\mid X)$ is incorrect. _Given_ $X = 1$, $Y$ is a _degenerate_ random variable that takes on value $1$ with probability $1$ and so $$E(Y\\mid X) = \\begin{cases}1, &X=1,\\\\1, &X=-1,\\\\2, & X=2,\\end{cases}$$
Perfect! Absolutely perfect! Thank you so much. It was just a matter of going back to the raw numbers and reassigning the ranks, not working with the ranks that I had.
I don't think you got my question. I already know in what symbols (and in what order in case of a multiple bet) to bet on each individual match. My problem is **figuring out the ideal number of triple and double bets I should play by looking at all the matches (and their respective symbol chances) *globally***.
This reply gives the theoretical basis of the examples provided in other answers.  The key idea is illustrated nicely in the first illustration of @DWin's answer (which I warmly recommend upvoting).
@Lizzan Are you interested in displaying each error type or just the overall error rate?
+1 Note, however, that there are differing conventions w/ respect to the use of terms in statistics. For example, 'beta' / $\\beta$ is often used to denote the true parameter that governs the data generating process, & 'beta hat' / $\\hat\\beta$ refers to the slope estimate calculated in your sample. In this case, they do not imply that the variables have been standardized 1st. This varying usage is unfortunate, but nonetheless real. It is important to be clear about how terms are being used when one encounters them, rather than assuming that everyone means the same thing.
@downvoter please state your reason !
+1 Wow! You went all-out! I'll play more with this on the full dataset and see what I come up with.
Glad I could help; I left a comment in your SE question.
I added some comments to clear the question (sorry for ambiguity) but you've understood me correctly. So do I need to add noise or random adjustments for the authorized training data to generate imposters data? Am I correct?
If I get some good correlations between some variables (which I did) when I put my environmental values from some region in some model (a linear regression here: 1st correlation test), then I expect to see similar correlation coeffient between the variables in other region (2nd correlation test is used to see if the two regions are similar in patterns) if the two regions are similar in environmental patterns (i.e. geographic pattern of variables in relation to other variables).
Could you elaborate a little on why you want to "detect geographic patterns"?  After all, there *will* be patterns, because there are strong geographic patterns in population distribution.  Therefore it would help to know what these "patterns" might mean for you: what would they explain or reveal?  How would they help you act in the future?
Can you maybe supply a source or reference for the equation $\\sqrt{|\\Sigma|}=\\prod\\sqrt{\\lambda_i}$?
Yes it does. Check out the book's webpage http://appliedpredictivemodeling.com for more info.
I'm not sure this question makes sense... For instance, I could take a bunch of weak learners, use a boosting algorithm to weight them, then "rip out" the boosting code and make one mega-classifier that performs identically to the ensemble. So... what are you asking exactly?
What makes a citation 'official'?
I wish I understood what this question was asking, because it sounds like it's asking something I should know. I presume its my own ignorance I've just run into, rather than a problem with the question, but it couldn't hurt to try to make the question clearer/more accessible either way. On the basis that it at least sounds interesting, I'm going to upvote.
Thanks. Pearson correlation shows a 0.085 meaning no correlation right? logically though delivery rates should be correlated with team size. Or am i wrong?
@atiretoo doesn't the model provide you with an estimated distribution for the number of seeds pollinated that you could compare to your hypothesized distribution?
That looks great! I'll try and see if i can implement it :)
to get correlation, your data will be paired. If the observation for one of the variables in a pair is missing, you'd normally exclude the other member from the calculation of the correlation.
Small tip: If you type `dput(calls)` and copy-paste the output into your question, the data can just be copy-pasted back into `R` and used immediately. That's very convenient for producing reproducible code.
#2 always applies as far as "test your code"! Different people have different styles on the last point, and there's no right answer. You could take the line that it's not a programmer's job to explain what is well explained elsewhere, or futile to document a program except by explaining use. In the Stata community, where I am active, good documentation seems widely appreciated and its lack is a concern, but the R community must have its own mores.
Can you clarify why you recommend a "scripting language"?
This result is the [Cauchy-Schwarz Inequality](http://en.wikipedia.org/wiki/Cauchy%E2%80%93Schwarz_inequality#Statement_of_the_inequality) in disguise: the standardized $x$'s and standardized $y$'s can be viewed as unit vectors (in a space whose dimension equals the data count, but that doesn't matter because according to Euclid two vectors--which implicitly include their common origin--determine a plane or just a line). The standardized $\\beta$ is the dot product of these vectors, which is the cosine of the angle between them. Cosines of angles always lie between $-1$ and $1$.
`extractAIC()` seems to work too (e.g., `extractAIC(m)[2]`).
+1 for stopping with the confidence intervals!