Id stringlengths 1 6 | PostTypeId stringclasses 7
values | AcceptedAnswerId stringlengths 1 6 ⌀ | ParentId stringlengths 1 6 ⌀ | Score stringlengths 1 4 | ViewCount stringlengths 1 7 ⌀ | Body stringlengths 0 38.7k | Title stringlengths 15 150 ⌀ | ContentLicense stringclasses 3
values | FavoriteCount stringclasses 3
values | CreationDate stringlengths 23 23 | LastActivityDate stringlengths 23 23 | LastEditDate stringlengths 23 23 ⌀ | LastEditorUserId stringlengths 1 6 ⌀ | OwnerUserId stringlengths 1 6 ⌀ | Tags list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6681 | 2 | null | 726 | 9 | null | >
[Statistics are] the only tools by which an opening can be cut through the formidable thicket of difficulties that bars the path of those who pursue the science of man.
-- Sir Francis [Galton](http://galton.org/)
| null | CC BY-SA 2.5 | null | 2011-01-28T20:23:49.323 | 2011-01-28T20:23:49.323 | null | null | 2592 | null |
6682 | 2 | null | 6680 | 3 | null | Here is the possible solution with taking a clarification in comment in mind, but still I think that the question is invalid as it stands.
```
##This gives the table A with both columns in character, which we will use
df<-rbind(c("Y",10),c("Y",12),c("Y",18),c("X",22), c("X",12), c("Z",11), c("Z",15))
> df
[,1] [,2... | null | CC BY-SA 2.5 | null | 2011-01-28T20:47:51.733 | 2011-01-28T20:47:51.733 | null | null | 2116 | null |
6683 | 2 | null | 6670 | 6 | null | I asked a [similar question](https://stats.stackexchange.com/questions/168/choosing-a-bandwidth-for-kernel-density-estimators) a few months ago. Rob Hyndman provided an excellent [answer](https://stats.stackexchange.com/questions/168/choosing-a-bandwidth-for-kernel-density-estimators/179#179) that recommends the Sheath... | null | CC BY-SA 2.5 | null | 2011-01-28T21:58:45.647 | 2011-01-28T21:58:45.647 | 2017-04-13T12:44:41.967 | -1 | 8 | null |
6684 | 1 | 6718 | null | 4 | 17116 | Note: I've updated the example case code, there were some errors in the previous version
Cross posted to R-help, because I half suspect this is 'unexpected behaviour'.
I want to predict values from an existing lm (linear model, e.g.
lm.obj) result in R using a new set of predictor variables (e.g.
newdata). Specificall... | How can one use the predict function on a lm object where the IVs have been dynamically scaled? | CC BY-SA 2.5 | null | 2011-01-28T22:32:16.647 | 2011-01-30T20:04:27.090 | 2011-01-29T02:00:13.550 | 196 | 196 | [
"r",
"regression"
] |
6685 | 2 | null | 6680 | 3 | null | Similar to what @mpiktas proposed, but using `aggregate`
```
# Construct the data frame
let <- c("Y", "Y", "Y", "X", "X", "Z", "Z")
num <- c(10, 12, 18, 22, 12, 11, 15)
df <- data.frame(let, num)
# Aggregate data by the first column.
# Do not apply any transformation to the data (use the identity function)
ag <- aggr... | null | CC BY-SA 2.5 | null | 2011-01-28T23:08:18.223 | 2011-01-28T23:08:18.223 | null | null | 582 | null |
6686 | 2 | null | 6684 | 1 | null | See if this console scrape shows what you might have wanted. Changed the names of the new data columns:
```
> dat <- data.frame(xxA = rnorm(20,10), xxB = rnorm(10,20))
> dat$out <- with(dat,xxA+xxB+xxA*xxB+rnorm(20,20))
> xVar <- "scale(xxA)"
> traceVar <- "scale(xxB)"
> DVname <- "out"
> lm.obj <- lm.re... | null | CC BY-SA 2.5 | null | 2011-01-29T00:28:42.120 | 2011-01-29T12:04:57.473 | 2011-01-29T12:04:57.473 | 2129 | 2129 | null |
6688 | 1 | null | null | 15 | 1388 | Suppose I want to build a binary classifier. I have several thousand features and only a few 10s of samples. From domain knowledge, I have a good reason to believe that the class label can be accurately predicted using only a few features, but I have no idea which ones. I also want the final decision rule to be easy... | Sane stepwise regression? | CC BY-SA 2.5 | null | 2011-01-29T04:44:13.400 | 2018-04-27T14:12:24.700 | 2011-01-29T14:07:37.390 | 1347 | 1347 | [
"regression",
"logistic",
"multiple-comparisons",
"stepwise-regression"
] |
6689 | 2 | null | 6421 | 13 | null | [LARS](http://en.wikipedia.org/wiki/Least-angle_regression) gets my vote. It combines linear regression with variable selection. Algorithms to compute it usually give you a collection of $k$ linear models, the $i$th one of which has nonzero coefficients for only $i$ regressors, so you can easily look at models of diffe... | null | CC BY-SA 2.5 | null | 2011-01-29T05:40:49.240 | 2011-01-29T05:40:49.240 | null | null | 795 | null |
6690 | 1 | 6691 | null | 4 | 488 | If I see `Rmath.h` in `/usr/share/R/include`, the signature of the function `dpois` or `Rf_dpois` is
```
double dpois(double, double, int);
```
However, if I do `?dpois` in `R`, I see:
```
dpois(x, lambda, log = FALSE)
```
Are these both the same thing? If yes, can someone please clarify?
Also I tried to find the ... | What is the difference between Rf_dpois in Rmath.h and the dpois that I use directly in R? | CC BY-SA 4.0 | null | 2011-01-29T06:45:35.563 | 2018-10-19T06:59:29.070 | 2018-10-19T06:59:29.070 | 128677 | 1307 | [
"r"
] |
6691 | 2 | null | 6690 | 3 | null | Yes they are the same. I am guessing that `x` is double because of [type conversions](http://en.wikipedia.org/wiki/Type_conversion). If `integer` is multiplied by `double` in C, the `double` is converted to integer. There are checks in the code that `x` is really integer, though it is of type `double`.
The code for ... | null | CC BY-SA 2.5 | null | 2011-01-29T06:55:11.320 | 2011-01-29T08:11:23.197 | 2011-01-29T08:11:23.197 | 2116 | 2116 | null |
6692 | 2 | null | 6421 | 42 | null | The answer is so simple that i have to write all this gibberish to make CV let me post it: [R](http://www.r-project.org)
| null | CC BY-SA 2.5 | null | 2011-01-29T08:53:30.500 | 2011-01-29T10:15:28.620 | 2011-01-29T10:15:28.620 | 704 | 704 | null |
6693 | 2 | null | 6690 | 3 | null | In reference to the question on how to find the source for headers of other functions, see this article in R News by Uwe Ligges:
Uwe Ligges. R Help Desk: [Accessing the sources](http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf). R News, 6(4):43-45, October 2006.
| null | CC BY-SA 2.5 | null | 2011-01-29T14:05:27.887 | 2011-01-29T14:05:27.887 | null | null | 1390 | null |
6694 | 2 | null | 6688 | 1 | null | For the purposes of my answer, I will denote the binary variable of interest as $Y_i \text{ ;}(i=1,\dots,n)$ and the predictors $X_{ij} \text{ ;} (j=1,\dots,p)$ and assume that $Y$ has values of $Y=0$ and $Y=1$. It will also be convenient to define $\gamma_m$ to indicate the model $m \text{ ;}(m=1,..,M)$, such that... | null | CC BY-SA 2.5 | null | 2011-01-29T16:25:14.063 | 2011-01-29T16:25:14.063 | null | null | 2392 | null |
6695 | 2 | null | 6690 | 5 | null | You could always test things, courtesy of [inline](http://cran.r-project.org/packages=inline) and [Rcpp](http://cran.r-project.org/packages=Rcpp).
Here we pass three lines of code to C++ to receive the two parameters, and then pass those to `Rf_dpois` (while setting the `log` argument to false):
```
R> library(Rcpp)
R... | null | CC BY-SA 2.5 | null | 2011-01-29T16:31:29.507 | 2011-01-29T16:31:29.507 | null | null | 334 | null |
6697 | 2 | null | 6421 | 11 | null | Just falling within the 15 year window, I believe, are the algorithms for controlling [False Discovery Rate](http://en.wikipedia.org/wiki/False_discovery_rate). I like the 'q-value' approach.
| null | CC BY-SA 2.5 | null | 2011-01-29T18:37:00.597 | 2011-01-29T18:37:00.597 | null | null | 795 | null |
6698 | 1 | 6699 | null | 3 | 2925 | Let's say you regress monthly stock returns, and the regression model has a standard error around such monthly stock returns of 2%. Next, you forecast the next year annual stock return based on the regressed monthly returns. What is the standard error around this annual stock return?
Some may think this is not a ver... | How do you compute the annual standard error of a regression model when the model itself is based on monthly observations? | CC BY-SA 2.5 | null | 2011-01-29T20:30:28.627 | 2011-04-28T23:46:12.220 | 2011-04-28T22:57:34.777 | 2970 | 1329 | [
"standard-error"
] |
6699 | 2 | null | 6698 | 2 | null | The general rule is $\sqrt N$. So from daily data, annual volatility would be estimated as `sd(v)* sqrt(255)`.
Hence for your example, multiply the estimated error by the square root of twelve.
Edit: In response to the follow-up comment, here is a complete worked example with real data. The annual volatility comes ou... | null | CC BY-SA 2.5 | null | 2011-01-29T20:32:23.547 | 2011-01-29T21:53:52.430 | 2011-01-29T21:53:52.430 | 334 | 334 | null |
6700 | 2 | null | 6658 | 2 | null | If I'm reading you right (and changing Tal's 4 to a 5), then at [http://en.wikipedia.org/wiki/Statistical_hypothesis_testing](http://en.wikipedia.org/wiki/Statistical_hypothesis_testing)
if you scroll halfway down you'll find the formula for "Two-proportion z-test, pooled for d0 = 0." I would think you'd want to do s... | null | CC BY-SA 2.5 | null | 2011-01-29T20:49:17.667 | 2011-01-31T18:48:45.210 | 2011-01-31T18:48:45.210 | 2669 | 2669 | null |
6701 | 2 | null | 949 | 9 | null | This post was originally intended as a long comment rather than a complete answer to the question at hand.
From the question, it's a little unclear if the interest lies only in the binary case or, perhaps, in more general cases where they may be continuous or take on other discrete values.
One example that doesn't quit... | null | CC BY-SA 3.0 | null | 2011-01-29T22:03:58.937 | 2012-09-20T12:47:09.693 | 2012-09-20T12:47:09.693 | 2970 | 2970 | null |
6702 | 1 | 274715 | null | 11 | 12855 | Here's what I want to do, but there seem to be no `predict` method for the mlogit. Any ideas?
```
library(mlogit)
data("Fishing", package = "mlogit")
Fish <- mlogit.data(Fishing, varying = c(2:9), shape = "wide", choice = "mode")
Fish_fit<-Fish[-1,]
Fish_test<-Fish[1,]
m <- mlogit(mode ~price+ catch | income, data = ... | Predict after running the mlogit function in R | CC BY-SA 2.5 | null | 2011-01-29T22:51:20.317 | 2017-04-20T03:43:53.080 | 2011-01-30T14:15:55.020 | null | 2817 | [
"r",
"logistic",
"logit",
"multinomial-distribution"
] |
6703 | 2 | null | 6609 | 2 | null | One way is to build an SPSS PLUM or NOMREG model that checks for an interaction between each predictor and a binary predictor, “time.” In that scenario you'd use just a single column for all the values of your outcome variable. For 1/2 the data set, time would be marked 0, and for the other half it'd be marked 1. Es... | null | CC BY-SA 2.5 | null | 2011-01-29T23:59:29.663 | 2011-02-25T03:13:15.720 | 2011-02-25T03:13:15.720 | 2669 | 2669 | null |
6704 | 2 | null | 6601 | 13 | null | Conditional probability probably leads to most mistakes in everyday experience. There are many harder concepts to grasp, of course, but people usually don't have to worry about them--this one they can't get away from & is a source of rampant misadventure.
| null | CC BY-SA 2.5 | null | 2011-01-30T00:05:34.997 | 2011-01-30T00:05:34.997 | null | null | 11954 | null |
6705 | 1 | null | null | 7 | 3174 | I'm doing an autocorrelation analysis for a spatially distributed collection of observations. To perform my analysis, I am using Moran's I statistic.
My questions are: (1) What are the implications and benefits of using different weighting functions, i.e. $d^{-1}$, $d^{-2}$, $\exp(-d)$, and (2) Is there any (perhaps in... | Choice of weight function in Moran's I | CC BY-SA 2.5 | null | 2011-01-30T01:20:12.840 | 2020-02-05T14:33:56.367 | null | null | 1283 | [
"clustering",
"autocorrelation",
"spatial",
"scale-invariance"
] |
6706 | 1 | 6708 | null | 7 | 7118 | I am doing the following to fit my data using an exponential function:
```
# Define the data
data <- c(67, 81, 93, 65, 18, 44, 31, 103, 64, 19, 27, 57, 63, 25, 22, 150,
31, 58, 93, 6, 86, 43, 17, 9, 78, 23, 75, 28, 37, 23, 108, 14, 137,
69, 58, 81, 62, 25, 54, 57, 65, 72, 17, 22, 170, 95, 38, 33, ... | How do I generate a QQ-Plot for data fitted using fitdistr? | CC BY-SA 2.5 | null | 2011-01-30T01:23:50.887 | 2014-11-21T01:17:12.637 | 2014-11-21T01:17:12.637 | 805 | 2164 | [
"r",
"distributions",
"goodness-of-fit",
"exponential-distribution",
"qq-plot"
] |
6707 | 1 | 6727 | null | 5 | 1925 | I've seen at least 3 sources on time series* state that the component of a series that is variously called random, stochastic, or noise (something clearly separate from any deterministic, patterned component) itself consists of 2 parts, a systematic part and an unsystematic part. I can't for the life of me figure out ... | A "systematic" part of a random time series component? | CC BY-SA 2.5 | null | 2011-01-30T01:50:47.830 | 2011-01-30T22:16:38.797 | null | null | 2669 | [
"time-series"
] |
6708 | 2 | null | 6706 | 9 | null | Try the following code:
```
simdata <- qexp(ppoints(length(data)), rate = params$estimate)
qqplot(data, simdata)
```
(Inspired by the base R implementation of `qqnorm`)
PS When using non-base R functions, you should state what library they come from. I had to Google to discover that `fitdistr` is from MASS.
| null | CC BY-SA 2.5 | null | 2011-01-30T01:53:42.750 | 2011-01-30T01:53:42.750 | null | null | 2975 | null |
6709 | 2 | null | 6655 | 2 | null | I would suggest that the type of estimator depends on a few things:
- What are the consequences of getting the estimate wrong? (e.g. is it less bad if your estimator is too high, compared to being too low? or are you indifferent about the direction of error? if an error is twice as big, is this twice as bad? is it pe... | null | CC BY-SA 2.5 | null | 2011-01-30T03:41:02.227 | 2011-01-30T03:41:02.227 | null | null | 2392 | null |
6710 | 2 | null | 6421 | 9 | null | Adding my own 5 cents, I believe the most significant breakthrough of the past 15 years has been Compressed Sensing. LARS, LASSO, and a host of other algorithms fall in this domain, in that Compressed Sensing explains why they work and extends them to other domains.
| null | CC BY-SA 2.5 | null | 2011-01-30T04:04:07.940 | 2011-01-30T04:04:07.940 | null | null | 30 | null |
6712 | 2 | null | 6670 | 1 | null | What I usually do is to calculate the plugin bandwidth using Silverman's formula (h_p) and then crossvalidate in the range of [h_p/5, 5h_p] to find the optimal bandwidth. This crossvalidation can be done either by using leave-one-out least squares crossvalidation or by leave-one-out-likelihood crossvalidation.
| null | CC BY-SA 2.5 | null | 2011-01-30T04:40:55.097 | 2011-01-30T04:40:55.097 | null | null | null | null |
6714 | 2 | null | 6652 | 21 | null | I wouldn't call the definition of CIs as wrong, but they are easy to mis-interpret, due to there being more than one definition of probability. CIs are based on the following definition of Probability (Frequentist or ontological)
(1)probability of a proposition=long run proportion of times that proposition is observed... | null | CC BY-SA 2.5 | null | 2011-01-30T06:15:56.497 | 2011-02-01T11:04:32.597 | 2011-02-01T11:04:32.597 | 2392 | 2392 | null |
6715 | 1 | 6716 | null | 8 | 155 | Please pardon me if this question is not clear. I am not sure if I am using the right terminologies.
I have conducted an experiment in different environments multiple times. So my data looks something like this:
```
Environment1 1.2 2.1 1.1 1.5 1.6
Environment2 4.2 2.6 3.5 2.5 2.9
Environment3 7.2 4.6 5.3 ... | Can someone help me understand what type of problem I am looking at? Not sure if this classifies as hypothesis-testing | CC BY-SA 2.5 | null | 2011-01-30T06:23:56.603 | 2011-01-30T06:43:32.580 | 2011-01-30T06:32:25.987 | 2164 | 2164 | [
"r",
"distributions",
"hypothesis-testing",
"statistical-significance",
"experiment-design"
] |
6716 | 2 | null | 6715 | 2 | null | You can do a [student test](http://en.wikipedia.org/wiki/Student%27s_t-test) to see if the mean is different between the group 4,6 and the rest. Even if your sample size is small you will conclude in a difference. Note that it will tell you that group 4,6 is significantly different in average from the rest but it won't... | null | CC BY-SA 2.5 | null | 2011-01-30T06:43:32.580 | 2011-01-30T06:43:32.580 | null | null | 223 | null |
6717 | 2 | null | 6707 | 3 | null | "random" is often used as if it was a real property of the data under study, where it should be replaced with "uncertain". To give an example, if I ask you what how much money you earned over the past month, and you don't tell me, it is not "random", but just uncertain. However, treating the uncertainty as if it was ... | null | CC BY-SA 2.5 | null | 2011-01-30T07:00:30.623 | 2011-01-30T07:00:30.623 | null | null | 2392 | null |
6718 | 2 | null | 6684 | 5 | null | When you use the `predict` with `newdata` argument you must supply the the data.frame with the same column names. In your code you have
```
newdata <- expand.grid(X1=c(-1,0,1),X2=c(-1,0,1))
names(newdata) <- c("scale(xxA)","scale(xxB)")
```
But the formula supplied to lm object is
```
out ~ scale(xxA)*scale(xxB)
```
... | null | CC BY-SA 2.5 | null | 2011-01-30T07:50:33.400 | 2011-01-30T20:04:27.090 | 2011-01-30T20:04:27.090 | 2116 | 2116 | null |
6719 | 2 | null | 6707 | 3 | null | Systematic and unsystematic are rather ambiguous terms. One of the possible explanations is given by @probabilityislogic. Another may be given [here.](http://en.wikipedia.org/wiki/Decomposition_of_time_series) Since the context you gave is time series, I think this might be related to [Wold's theorem](http://en.wikipe... | null | CC BY-SA 2.5 | null | 2011-01-30T09:21:36.527 | 2011-01-30T13:51:17.730 | 2011-01-30T13:51:17.730 | 2116 | 2116 | null |
6720 | 1 | 6726 | null | 10 | 4740 | An exponential model is a model described by following equation:
$$\hat{y_{i}}=\beta_{0}\cdot e^{\beta_{1}x_{1i}+\ldots+\beta_{k}x_{ki}}$$
The most common approach used to estimate such model is linearization, which can be done easily by calculating logarithms of both sides. What are the other approaches? I'm especiall... | Estimation of exponential model | CC BY-SA 2.5 | null | 2011-01-30T11:56:51.913 | 2011-01-31T14:48:08.047 | 2011-01-31T09:50:09.067 | 1643 | 1643 | [
"estimation",
"nonlinear-regression"
] |
6721 | 2 | null | 6720 | 10 | null | This is a [generalized linear model](http://en.wikipedia.org/wiki/Generalized_linear_model) (GLM) with a log [link function](http://en.wikipedia.org/wiki/Generalized_linear_model#Link_function).
Any probability distribution on $[0,\infty)$ with non-zero density at zero will handle $y_i=0$ in some observations; the mos... | null | CC BY-SA 2.5 | null | 2011-01-30T12:30:39.593 | 2011-01-30T12:50:51.010 | 2011-01-30T12:50:51.010 | 449 | 449 | null |
6722 | 2 | null | 6720 | 3 | null | You can always use [non-linear least squares](http://en.wikipedia.org/wiki/Non-linear_least_squares). Then your model will be:
$$y_i=\beta_0\exp(\beta_1x_{1i}+...+\beta_kx_{ki})+\varepsilon_i$$
The zeroes in $y_i$ then will be treated as deviations from the non-linear trend.
| null | CC BY-SA 2.5 | null | 2011-01-30T14:04:34.183 | 2011-01-30T14:04:34.183 | null | null | 2116 | null |
6723 | 1 | 6752 | null | 6 | 8473 | Given the dataset [cars.txt](http://dl.dropbox.com/u/138632/statistics/R%20data/cars.txt), we want to formulate a good regression model for the Midrange Price using the variables Horsepower, Length, Luggage, Uturn, Wheelbase, and Width. Both:
- using all possible subsets selection, and
- using an automatic selection ... | Regression selection using all possible subsets selection and automatic selection techniques | CC BY-SA 3.0 | null | 2011-01-30T15:14:03.557 | 2011-05-27T04:02:47.707 | 2011-05-27T04:02:47.707 | 159 | 2980 | [
"r",
"regression",
"model-selection",
"stepwise-regression"
] |
6724 | 2 | null | 4556 | 10 | null | The "mechanical" result of just plugging in $z = 1$ into the transfer response is essentially a product of two facts. The steady-state gain is (usually, I believe) defined as the (magnitude of the) limiting response as $t \to \infty$ of the system to a unit-step input.
The so-called final-value theorem states that, if ... | null | CC BY-SA 2.5 | null | 2011-01-30T17:39:27.313 | 2011-01-30T18:04:18.460 | 2011-01-30T18:04:18.460 | 2970 | 2970 | null |
6725 | 1 | null | null | 4 | 266 | I have to implement a genetic algorithm and therefore select the "fittest" of all possible members of a generation.
I have the following arrays of fitnesses, their weighed equivalents and a cumulative array.
```
Fitnesses: [0.2, 0.0, 0.2, 0.0, 0.0, 0.0]
Weighed Fitnesses: [0.5, 0.0, 0.5, 0.0, 0.0, 0.0]
Cumulative Fitne... | Pick a random item with the help of an array of cumulative probabilities | CC BY-SA 2.5 | null | 2011-01-30T17:56:44.463 | 2011-01-31T00:08:48.627 | null | null | 1205 | [
"random-variable",
"random-generation"
] |
6726 | 2 | null | 6720 | 11 | null | There are several issues here.
(1) The model needs to be explicitly probabilistic. In almost all cases there will be no set of parameters for which the lhs matches the rhs for all your data: there will be residuals. You need to make assumptions about those residuals. Do you expect them to be zero on the average? To... | null | CC BY-SA 2.5 | null | 2011-01-30T17:57:06.893 | 2011-01-31T14:48:08.047 | 2011-01-31T14:48:08.047 | 919 | 919 | null |
6727 | 2 | null | 6707 | 6 | null | The Burns reference that you are quoting seems to dividing the stochastic part into autocorrelation error, which is a byproduct of any time series analysis (and is systematic), vs. truly random error which is uncontrollable.
-Ralph Winters
| null | CC BY-SA 2.5 | null | 2011-01-30T22:16:38.797 | 2011-01-30T22:16:38.797 | null | null | 3489 | null |
6728 | 1 | 6729 | null | 43 | 32671 | I was trying to fit my data into various models and figured out that the `fitdistr` function from library `MASS` of `R` gives me `Negative Binomial` as the best-fit. Now from the [wiki](http://en.wikipedia.org/wiki/Negative_binomial_distribution) page, the definition is given as:
>
NegBin(r,p) distribution describes t... | Understanding the parameters inside the Negative Binomial Distribution | CC BY-SA 2.5 | null | 2011-01-30T23:22:12.240 | 2019-03-08T00:18:15.763 | null | null | 2164 | [
"r",
"distributions",
"modeling",
"negative-binomial-distribution"
] |
6729 | 2 | null | 6728 | 49 | null | You should look [further down the Wikipedia article on the NB](https://en.wikipedia.org/wiki/Negative_binomial_distribution#Gamma%E2%80%93Poisson_mixture), where it says "gamma-Poisson mixture". While the definition you cite (which I call the "coin-flipping" definition since I usually define it for classes as "suppose ... | null | CC BY-SA 4.0 | null | 2011-01-30T23:58:00.913 | 2019-03-08T00:18:15.763 | 2019-03-08T00:18:15.763 | 2126 | 2126 | null |
6730 | 2 | null | 6725 | 2 | null | Whuber answer is of course very good and simple, but if You are looking for something faster (binary search approach needs $O(logn)$ steps) then You can look at Walker's alias method, it is described well in Knuths Art of Computer Programming, unfortunatelly I can't tell You the exact page because I have only Polish ve... | null | CC BY-SA 2.5 | null | 2011-01-31T00:08:48.627 | 2011-01-31T00:08:48.627 | null | null | 1643 | null |
6731 | 1 | 6732 | null | 11 | 5103 | I have a design matrix of p regressors, n observations, and I am trying to compute the sample variance-covariance matrix of the parameters. I am trying to directly calculate it using svd.
I am using R, when I take svd of the design matrix, I get three components: a matrix $U$ which is $n \times p$, a matrix $D$ which ... | Using Singular Value Decomposition to Compute Variance Covariance Matrix from linear regression model | CC BY-SA 2.5 | null | 2011-01-31T01:11:51.263 | 2011-01-31T07:17:26.280 | 2011-01-31T07:17:26.280 | 2116 | 2984 | [
"r",
"regression"
] |
6732 | 2 | null | 6731 | 16 | null | First, recall that under assumptions of multivariate normality of the linear-regression model, we have that
$$
\hat{\beta} \sim \mathcal{N}( \beta, \sigma^2 (X^T X)^{-1} ) .
$$
Now, if $X = U D V^T$ where the right-hand side is the SVD of X, then we get that $X^T X = V D U^T U D V = V D^2 V^T$. Hence,
$$
(X^T X)^{-1... | null | CC BY-SA 2.5 | null | 2011-01-31T03:04:22.890 | 2011-01-31T03:04:22.890 | null | null | 2970 | null |
6733 | 1 | 6735 | null | 4 | 251 | Say I have a list with $n$ elements (say number $1$'s) and I want to do 1000 random changes to them, such as a $+1$. If I (1) picked a random element, (2) changed it, and then (3) did these two steps (1)+(2) another 999 times, this would probably be completely random, right?
Now, what if, whenever I change an element,... | Picking random elements from a list – still random if they are reinserted at the end? | CC BY-SA 2.5 | null | 2011-01-31T03:08:41.140 | 2011-01-31T04:16:40.627 | null | null | 2440 | [
"probability"
] |
6734 | 1 | 6739 | null | 10 | 4229 | I have been reading the description of ridge regression in [Applied Linear Statistical Models](http://rads.stackoverflow.com/amzn/click/007310874X), 5th Ed chapter 11. The ridge regression is done on body fat data available [here](http://www.cst.cmich.edu/users/lee1c/spss/V16_materials/DataSets_v16/BodyFat-TxtFormat.tx... | Difference between ridge regression implementation in R and SAS | CC BY-SA 3.0 | null | 2011-01-31T03:14:14.757 | 2014-07-09T23:37:13.357 | 2014-07-09T23:37:13.357 | 7290 | 2040 | [
"r",
"sas",
"ridge-regression"
] |
6735 | 2 | null | 6733 | 9 | null | It's necessary to be a little bit careful about what you mean by "random" and "completely random" here.
What you are describing, at least in your first scheme is a set of random draws such that the resulting vector is multinomially distributed with n = 1000 and probabilities $p_1 = p_2 = \cdots = p_n = 1/n$. Even in yo... | null | CC BY-SA 2.5 | null | 2011-01-31T03:24:39.737 | 2011-01-31T04:16:40.627 | 2011-01-31T04:16:40.627 | 2970 | 2970 | null |
6736 | 1 | null | null | 6 | 389 | What properties do these measures have and how can I determine which one is better for a given purpose? What are extreme cases where they differ a lot?
| Properties of Battacharyya distance vs Kullback-Leibler divergence | CC BY-SA 2.5 | null | 2011-01-31T05:39:54.900 | 2021-03-03T12:01:20.113 | null | null | 2440 | [
"distributions",
"probability",
"kullback-leibler"
] |
6737 | 2 | null | 2356 | 30 | null | This is a "fleshed out" example given in a book written by Larry Wasserman [All of statistics](https://www.ic.unicamp.br/~wainer/cursos/1s2013/ml/livro.pdf) on Page 216 (12.8 Strengths and Weaknesses of Bayesian
Inference). I basically provide what Wasserman doesn't in his book 1) an explanation for what is actually h... | null | CC BY-SA 4.0 | null | 2011-01-31T06:44:48.373 | 2018-08-21T11:24:31.280 | 2018-08-21T11:24:31.280 | 53690 | 2392 | null |
6738 | 2 | null | 6736 | 1 | null | First properties are explained competently [here](http://en.wikipedia.org/wiki/Kullback-Leibler_divergence) and
[there](http://en.wikipedia.org/wiki/Bhattacharyya_distance).
Which one is better suited to a given purpose will depend on said given purpose so you might think about rephrasing this part of your question.
| null | CC BY-SA 2.5 | null | 2011-01-31T07:43:50.690 | 2011-01-31T07:43:50.690 | null | null | 2592 | null |
6739 | 2 | null | 6734 | 6 | null | Though ridge regression looks [at first like simple algorithm](http://en.wikipedia.org/wiki/Ridge_regression) the devil is in the details. Apparently original variables are scaled, and parameter $\lambda$ is not the parameter you would think it is given the original description. From what I gathered reading [the refere... | null | CC BY-SA 2.5 | null | 2011-01-31T08:18:17.773 | 2011-01-31T08:18:17.773 | null | null | 2116 | null |
6740 | 1 | 6742 | null | 6 | 2921 | I am reading the second edition of Categorical Data Analysis by Alan Agresti, and somehow stuck in the following second paragraph:

I don't quite understand why $\beta\pi(\hat{x})(1 - \pi(\hat{x}))$ will give the probability when $x = 26.3$, can anyone... | Alternative ways for interpretation of odds | CC BY-SA 2.5 | null | 2011-01-31T08:43:05.747 | 2011-01-31T14:50:46.843 | 2011-01-31T14:50:46.843 | 930 | 588 | [
"logistic"
] |
6742 | 2 | null | 6740 | 6 | null | The answer is near the bottom of [p166](http://books.google.co.uk/books?id=hpEzw4T0sPUC&pg=PA166). It's using a linear approximation (what social scientists would call a 'marginal effect'). A small change $\delta x$ in $x$ gives a change in probability of:
$$\delta\pi \approx \frac{\partial \pi(x)}{\partial x} \delta x... | null | CC BY-SA 2.5 | null | 2011-01-31T11:19:42.163 | 2011-01-31T11:27:32.697 | 2011-01-31T11:27:32.697 | 449 | 449 | null |
6744 | 1 | 6750 | null | 4 | 794 |
I have no math or stats background, so this may be a real dumbo question.
I'm developing a time estimation app which would let user enter her worst case and best case estimates, and then select a probability curve which she feels looks realistic.
I needed to draw some kind of curve that sums up to 1, so I came up wi... | Get distribution curve characteristics by selecting peak point? | CC BY-SA 2.5 | null | 2011-01-31T13:12:42.683 | 2011-01-31T15:35:37.323 | 2011-01-31T13:25:01.897 | 2989 | 2989 | [
"distributions",
"estimation",
"normal-distribution"
] |
6746 | 1 | null | null | 11 | 605 | I'm working with a two-state process with $x_t$ in $\{1, -1\}$ for $t = 1, 2, \ldots$
The autocorrelation function is indicative of a process with long-memory, i.e. it displays a power law decay with an exponent < 1. You can simulate a similar series in R with:
```
> library(fArma)
> x<-fgnSim(10000,H=0.8)
> x<-sign(x)... | Predicting long-memory processes | CC BY-SA 2.5 | null | 2011-01-31T14:03:05.300 | 2019-10-31T10:59:54.217 | 2019-10-31T10:59:54.217 | 11887 | 2425 | [
"time-series",
"predictive-models",
"autocorrelation",
"long-range-dependence"
] |
6747 | 1 | 6749 | null | 5 | 700 | I want to measure the correlation between two 1D point processes $x$ and $y$. Ordinarily I could use the bivariate K-function
$K(t) = \frac{T}{n_xn_y} \sum_{i=1}^{n_x} \sum_{j=1}^{n_y} w(x_i,y_j) I[d(x_i,y_j)<t]$
where $n_x$ is the number of observations in $x$ and $n_y$ is the number of observations in $y$. Deviation ... | Correlation of two 1d point processes with non-uniform unconditional distribution | CC BY-SA 2.5 | null | 2011-01-31T14:10:18.723 | 2011-02-01T12:09:07.593 | 2011-01-31T15:14:46.450 | 919 | 2425 | [
"correlation",
"cross-correlation",
"point-process"
] |
6748 | 2 | null | 6705 | 3 | null | Although not within the domain of geostatistics, for question #2, I would casually say the most frequent weighting function used in my field (Criminology) would be a a binary weighting scheme. Although I have rarely seen a good theoretical or empirical argument to use one weighting scheme over another (or how one defin... | null | CC BY-SA 2.5 | null | 2011-01-31T14:37:55.117 | 2011-01-31T14:43:16.333 | 2011-01-31T14:43:16.333 | 1036 | 1036 | null |
6749 | 2 | null | 6747 | 4 | null | Yes. The key is that how you measure correlation does not change, but the expected value does depend on the hypothesized underlying process.
$K$ (and cross-$K$, which is what you are looking at) is defined generally for inhomogeneous point processes. For a good discussion with examples see [Philip Dixon's analysis](h... | null | CC BY-SA 2.5 | null | 2011-01-31T15:14:21.927 | 2011-01-31T15:14:21.927 | null | null | 919 | null |
6750 | 2 | null | 6744 | 5 | null | Because normal distributions are symmetric, and it's natural to think of "best" and "worst" cases symmetrically (e.g., the chance of the best case is no greater than 5% and the chance of the worst case is no less than the same percent), they are not likely to work well in this application.
In effect you have three degr... | null | CC BY-SA 2.5 | null | 2011-01-31T15:34:01.507 | 2011-01-31T15:34:01.507 | null | null | 919 | null |
6751 | 2 | null | 6744 | 2 | null | The normal curve is not going to work for you:
- it is not constrained by a minimum/maximum
- it is symmetric around the peak
- it has a very restrictive shape
There are loads of other statistical distributions that would probably fit your needs better. I would especially look at distributions confined to the 0-1 ... | null | CC BY-SA 2.5 | null | 2011-01-31T15:35:37.323 | 2011-01-31T15:35:37.323 | null | null | 279 | null |
6752 | 2 | null | 6723 | 5 | null | For the second part, you must interpret the output as the steps towards your final model.
For example, in the forward case you begin with
Start: AIC=377.95
cars$MidrangePrice ~ 1
```
Df Sum of Sq RSS AIC
+ cars$Horsepower 1 4979.3 3054.9 300.66
+ cars$Wheelbase 1 3172.3 4862.0 338.... | null | CC BY-SA 2.5 | null | 2011-01-31T15:40:37.687 | 2011-01-31T15:40:37.687 | null | null | 2902 | null |
6753 | 1 | 32356 | null | 6 | 6630 | ... instead of e.g. the popular Equal-Width-Histograms.
Additional question: What is a good/robust rule of the thumb to calculate the number of bins for equal frequency histograms (like the [Freedmann-Diaconis-Rule](https://stats.stackexchange.com/questions/798/calculating-optimal-number-of-bins-in-a-histogram-for-n-w... | When to use Equal-Frequency-Histograms | CC BY-SA 2.5 | null | 2011-01-31T16:41:29.663 | 2012-07-19T15:38:19.587 | 2017-04-13T12:44:29.013 | -1 | 264 | [
"histogram",
"rule-of-thumb"
] |
6754 | 1 | null | null | 1 | 175 | I am a beginner in statistics, and I want to learn machine learning :). Therefore, I have gathered some sample data to practice. But, the problem is I want to create a feature (or attribute), which is common for every entity. But, this feature is observed and measured for entity X in Y meters and Z seconds, and for ent... | What should I do to compare different sets of data? | CC BY-SA 2.5 | null | 2011-01-31T16:46:08.220 | 2011-01-31T18:21:57.650 | 2011-01-31T18:21:57.650 | 930 | 2170 | [
"multiple-comparisons",
"feature-selection",
"normalization",
"weka"
] |
6755 | 1 | 6757 | null | 7 | 2767 | The data files from [http://www.csie.ntu.edu.tw/~cjlin/libsvm/](http://www.csie.ntu.edu.tw/~cjlin/libsvm/) are in 'svm' format. I am trying to read this in to sparse matrix representation in R. Is there an easy/efficient way to do this?
Here is what I am doing now: read in file line by line (800,000 lines), for each ... | Reading in SVM files in R (libsvm) | CC BY-SA 2.5 | null | 2011-01-31T17:46:43.547 | 2011-02-01T18:58:10.837 | 2011-01-31T18:40:30.193 | 2310 | 2310 | [
"svm",
"matrix",
"dataset"
] |
6757 | 2 | null | 6755 | 4 | null | The `e1071` package has a means for exporting to the libsvm "svm" format in [the write.svm function](http://ugrad.stat.ubc.ca/R/library/e1071/html/write.svm.html). But to the best of my knowledge, there is no `read.svm` function.
| null | CC BY-SA 2.5 | null | 2011-01-31T19:01:59.317 | 2011-01-31T19:01:59.317 | null | null | 5 | null |
6758 | 1 | 6775 | null | 15 | 18173 | I've fit a model with several independent variables, one of which is the lag of the dependent variable, using the dynlm package.
Assuming I have 1-step-ahead forecasts for my independent variables, how do I get 1-step-ahead forecasts for my dependent variables?
Here is an example:
```
library(dynlm)
y<-arima.sim(model... | 1-step-ahead predictions with dynlm R package | CC BY-SA 2.5 | null | 2011-01-31T19:58:00.220 | 2020-04-15T18:09:19.697 | 2011-01-31T23:33:00.067 | 2817 | 2817 | [
"r",
"dynamic-regression"
] |
6759 | 1 | 6800 | null | 71 | 472242 | How can I remove duplicate rows from this example data frame?
```
A 1
A 1
A 2
B 4
B 1
B 1
C 2
C 2
```
I would like to remove the duplicates based on both the columns:
```
A 1
A 2
B 4
B 1
C 2
```
Order is not important.
| Removing duplicated rows data frame in R | CC BY-SA 3.0 | null | 2011-01-31T19:58:19.363 | 2015-08-30T20:20:35.677 | 2015-08-30T20:20:35.677 | 62183 | 2725 | [
"r"
] |
6760 | 2 | null | 6759 | 51 | null | You are looking for `unique()`.
```
a <- c(rep("A", 3), rep("B", 3), rep("C",2))
b <- c(1,1,2,4,1,1,2,2)
df <-data.frame(a,b)
unique(df)
> unique(df)
a b
1 A 1
3 A 2
4 B 4
5 B 1
7 C 2
```
| null | CC BY-SA 2.5 | null | 2011-01-31T20:22:27.047 | 2011-01-31T20:22:27.047 | null | null | 307 | null |
6761 | 2 | null | 6544 | 2 | null | It's clear the solution I posted previously is inadequate and inelegant. Here is my second attempt, which 100% solves my problem. Please let me know if you spot any bugs! I will cross post to stack overflow, if you all think that would be a better place to get comments on my code.
```
#A function to iteratively pred... | null | CC BY-SA 2.5 | null | 2011-01-31T21:04:56.823 | 2011-01-31T21:04:56.823 | null | null | 2817 | null |
6762 | 1 | 6766 | null | 4 | 805 | We have n actors. Each actor chooses from n*2 actions. How can I calculate the probability that at least one actor will choose a unique outcome?
For example, say we have 5 pickup artists in a town with 10 bars. Each PUA chooses a bar at random. What are the odds that at least one PUA will have a bar to himself/herself?... | Probability of at least one unique outcome | CC BY-SA 2.5 | 0 | 2011-01-31T22:49:27.690 | 2016-08-25T20:44:44.043 | 2016-08-25T20:44:44.043 | 101426 | 2995 | [
"probability",
"combinatorics"
] |
6763 | 1 | null | null | 2 | 490 | I have 80 chemical batches, each of which has 8 associated measurements like pH, viscosity, etc. Is there a way to use Principal Components Analysis or Factor Analysis to group the similar batches together? I know I can use cluster analysis, but I want to have a different visual representation of batch groups other t... | Statistically group chemical batches | CC BY-SA 2.5 | null | 2011-01-31T23:06:13.850 | 2011-05-02T13:52:06.720 | 2011-02-01T00:14:02.047 | null | 2473 | [
"pca",
"factor-analysis"
] |
6766 | 2 | null | 6762 | 5 | null | This is not a simple calculation in general, though the probability will be almost 1 if $n$ is any substantial size.
To take your example of five people and 10 bars, there are $10^5$, i.e 100,000 possible equally-likely distributions. All of these will have at least one person alone, except the 10 cases where all f... | null | CC BY-SA 2.5 | null | 2011-02-01T00:44:41.830 | 2011-02-01T14:56:57.243 | 2011-02-01T14:56:57.243 | 919 | 2958 | null |
6767 | 2 | null | 6763 | 0 | null | You need to be more specific about what you mean by "similar", and provide some type of example. Maybe the following will help as an example of 8 batches with 3 measurements. Feel free to change it if you think it will help.
```
texinp <- "
Batch M1 M2 M3
1 0.01 14 -123
2 0.03 23 30
3 0.02 12 23
4 0.... | null | CC BY-SA 2.5 | null | 2011-02-01T00:49:31.910 | 2011-02-01T02:04:59.757 | 2011-02-01T02:04:59.757 | 2775 | 2775 | null |
6768 | 2 | null | 6763 | 1 | null | You'll be hard-pressed to show an 8-D representation of sets of similar batches using anything but a dreary table. But, along the lines of Bill's point I think, if you're willing to select the 3 most interesting or most discriminating dimensions, you could show where each batch falls within a cube defined by those 3. ... | null | CC BY-SA 2.5 | null | 2011-02-01T01:03:26.380 | 2011-02-01T01:03:26.380 | null | null | 2669 | null |
6770 | 1 | 7149 | null | 5 | 6478 | I'm writing a program for an assignment for my Probability and Statistics course. This program performs several millions of simulated coin tosses, and then analyses various properties of the generated sequence.
One of the things it does is count how many runs does the generated sequence contain, and their lengths. One... | Expected number of runs of length n in coin toss | CC BY-SA 3.0 | null | 2011-02-01T01:51:58.023 | 2020-09-06T18:49:39.783 | 2013-08-28T19:32:19.017 | 27581 | 2996 | [
"self-study",
"binomial-distribution",
"simulation"
] |
6771 | 2 | null | 6728 | 11 | null | As I mentioned in my earlier post to you, I'm working on getting my head around fitting a distribution to count data also. Here's among what I've learned:
When the variance is greater than the mean, overdispersion is evident and thus the negative binomial distribution is likely appropriate. If the variance and mean are... | null | CC BY-SA 3.0 | null | 2011-02-01T04:54:02.557 | 2012-10-07T23:25:50.940 | 2012-10-07T23:25:50.940 | 7290 | 2730 | null |
6772 | 1 | 8644 | null | 7 | 1586 | Not sure if you can help me but here's the problem.
I have two binomial proportions A and B (95% CI) -
$A = 2\% \pm 0.2\%,\quad B = 3\% \pm 0.2\%.$
In other words, B's proportion is 50% higher than A's.
Business people tend to prefer speaking about this difference in terms of a percentage increase. In other words, B's ... | How to compute Confidence Interval associated to a Binomial proportion's increase? | CC BY-SA 2.5 | null | 2011-02-01T05:58:26.000 | 2011-03-22T22:11:13.873 | 2011-03-22T22:11:13.873 | 930 | 2595 | [
"r",
"confidence-interval",
"binomial-distribution",
"proportion"
] |
6773 | 1 | 6872 | null | 6 | 1386 | I have a logistic regression model in GeoBugs to estimate predictors of prevalence of a disease. Can anyone tell me if there is a simple way to determine the lower and upper bounds of phi for spatial.exp.
This is part of the model:
```
Infected[i] ~ dbin(p[i], tested[i])
logit(p[i]) <- alpha + beta1*covar1[i] + beta2*c... | Geostatistical analysis using spatial.exp in WinBugs | CC BY-SA 2.5 | null | 2011-02-01T06:35:55.837 | 2011-02-04T04:27:12.527 | 2011-02-04T04:23:15.950 | 1834 | 1834 | [
"bayesian",
"logistic",
"spatial",
"bugs"
] |
6774 | 2 | null | 6763 | 0 | null | I'm not pretty sure, but i think that if you more variable than observation the Partial Least Square (PLS) regression is the right tool for you, and it's commonly used by chemometrician.
As you know this site is R biased and i use R too, so i'll recommend to take a look at pls package package which can also do princip... | null | CC BY-SA 2.5 | null | 2011-02-01T07:30:18.610 | 2011-02-01T07:55:29.913 | 2011-02-01T07:55:29.913 | 2028 | 2028 | null |
6775 | 2 | null | 6758 | 13 | null | Congratulations, you have found a bug. Prediction for `dynlm` with new data is broken if lagged variables are used. To see why look at the output of
```
predict(model)
predict(model,newdata=data)
```
The results should be the same, but they are not. Without `newdata` argument, the `predict` function basically grabs `... | null | CC BY-SA 3.0 | null | 2011-02-01T07:39:48.617 | 2012-02-17T09:20:06.207 | 2012-02-17T09:20:06.207 | 2116 | 2116 | null |
6776 | 1 | null | null | 5 | 1151 | I would appreciate some help getting some EM stuff straight. So, say I generate data in R as follows:
```
N <- 100
epsilon <- rnorm(N)
X <- 10*runif(N)
beta.0 <- 10
beta.1 <- 3
sigma <- 2
Y <- beta.0 + beta.1 * X + sigma * epsilon
epsilon2 <- rnorm(N)
X2 <- 10*runif(N)
Y2 <- 3 - X2 + 0.25 * ep... | Understanding expectation maximization for simple 2 linear mixture case | CC BY-SA 2.5 | null | 2011-02-01T09:07:09.633 | 2011-08-24T23:34:27.057 | 2011-03-27T16:04:19.703 | 919 | 2693 | [
"r",
"machine-learning",
"mixture-distribution"
] |
6777 | 1 | null | null | 4 | 195 | I would like to apply Bayesian network on some data. However, some of the variables are related to time.
E.g. Number of time he/she visit library.
As the value can be defined as Total number of this person visits, Average weekly number of he/she visit, Daily number of visits, or even Number of visits in the last 3 da... | How should I deal with features with time related values in Bayesian network? | CC BY-SA 2.5 | null | 2011-02-01T10:56:25.047 | 2016-05-01T20:19:23.587 | 2016-05-01T20:19:23.587 | 7290 | 2454 | [
"time-series",
"bayesian"
] |
6778 | 2 | null | 6747 | 0 | null | It's a little weird to answer my own question, but...
To address the non-stationarity issue, it seems as though it's not particularly tricky to compute the expected $K$-function under the hypothesis of independent event times. In particular, let's say that we're looking at point processes on the interval $I=[0,T]$, and... | null | CC BY-SA 2.5 | null | 2011-02-01T12:09:07.593 | 2011-02-01T12:09:07.593 | null | null | 2425 | null |
6779 | 1 | 6782 | null | 7 | 3392 | Apologies in advance - I'm a bit of a newbie with R but I've been Google-ing this for weeks and I haven't found a straight answer.
The problem
Basically, I'm looking to plot proportions with their confidence intervals on a box and whiskers plot using the R environment.
i.e. Plot the results of binom.test(100,1000) and ... | Plotting binomial proportions on a box & whiskers plot using R | CC BY-SA 2.5 | null | 2011-02-01T12:51:07.040 | 2011-02-01T14:57:09.207 | 2011-02-01T14:57:09.207 | null | 2595 | [
"r",
"data-visualization",
"boxplot"
] |
6780 | 1 | 6781 | null | 30 | 19889 | I have several query frequencies, and I need to estimate the coefficient of Zipf's law. These are the top frequencies:
```
26486
12053
5052
3033
2536
2391
1444
1220
1152
1039
```
| How to calculate Zipf's law coefficient from a set of top frequencies? | CC BY-SA 2.5 | null | 2011-02-01T13:24:57.997 | 2021-11-30T18:52:21.957 | 2011-03-15T19:04:43.443 | 8 | 2998 | [
"distributions",
"estimation",
"pareto-distribution",
"zipf"
] |
6781 | 2 | null | 6780 | 24 | null | Update I've updated the code with maximum likelihood estimator as per @whuber suggestion. Minimizing sum of squares of differences between log theoretical probabilities and log frequencies though gives an answer would be a statistical procedure if it could be shown that it is some kind of M-estimator. Unfortunately I c... | null | CC BY-SA 3.0 | null | 2011-02-01T14:12:29.077 | 2015-01-19T17:58:47.520 | 2015-01-19T17:58:47.520 | -1 | 2116 | null |
6782 | 2 | null | 6779 | 6 | null | This really does look to be more appropriate to an [r] tagged question in SO but there seems to be a surprisingly wide degree of tolerance for such questions in CV, so here goes. The answer also assumes you did not really want to use the existing `boxplot()` function which is what would be used to construct a true box-... | null | CC BY-SA 2.5 | null | 2011-02-01T14:28:40.207 | 2011-02-01T14:34:04.300 | 2011-02-01T14:34:04.300 | 2129 | 2129 | null |
6784 | 2 | null | 6544 | 2 | null | One more method, which has been suggested in other topics, is to just use the arima function with xregs. Arima seems to be able to make forecasts from a new set of xregs just fine.
| null | CC BY-SA 2.5 | null | 2011-02-01T16:19:03.493 | 2011-02-01T16:19:03.493 | null | null | 2817 | null |
6785 | 2 | null | 6777 | 2 | null | I am afraid you won't like this answer, but it depends on what you want to do.
Non-Time-Series-Modelling-Point of View
Here is an example: Suppose you want to predict whether a certain person is visiting the library at the next day. The starting point for your data is hence the data-id + person_id + label (visit=true/... | null | CC BY-SA 2.5 | null | 2011-02-01T17:08:20.320 | 2011-02-01T17:08:20.320 | null | null | 264 | null |
6786 | 2 | null | 6780 | 26 | null | There are several issues before us in any estimation problem:
- Estimate the parameter.
- Assess the quality of that estimate.
- Explore the data.
- Evaluate the fit.
For those who would use statistical methods for understanding and communication, the first should never be done without the others.
For estimation ... | null | CC BY-SA 3.0 | null | 2011-02-01T17:22:39.173 | 2016-11-30T16:33:14.047 | 2017-04-13T12:44:23.203 | -1 | 919 | null |
6787 | 1 | null | null | 3 | 252 | I've identified a Single Nucleotide Polymorphism (SNP) that is associated with a variable of interest (lets just call it height) using a Genome Wide Association Study (GWAS). The SNP can be of the values A/A, A/G or G/G in each of the 69 samples.
I also have gene expression data for the 69 samples and it appears that t... | Assessing conditional independence of genes in Trans-eQTL cluster | CC BY-SA 2.5 | null | 2011-02-01T17:54:27.250 | 2011-02-01T22:17:04.600 | 2011-02-01T22:17:04.600 | 930 | null | [
"regression",
"independence",
"genetics"
] |
6788 | 2 | null | 6770 | 2 | null | You have n independent Bernoulli rv, $X_1, X_2, ..., X_n$ with $P(X_i=1)=P(X_i=0)=p=1/2$. You generate n bits $b_1, b_2, ..., b_n$, as observations on this sequence. Let N be the rv giving the number of runs of one, for example, in the simulated sequence of bits.
$N=\sum_{i=1}^n Y_i$, where $Y_i$ is the random variabl... | null | CC BY-SA 4.0 | null | 2011-02-01T18:12:51.627 | 2020-09-06T18:49:39.783 | 2020-09-06T18:49:39.783 | 2376 | 2376 | null |
6789 | 2 | null | 6755 | 4 | null | I found a way that is at least now feasible.
Instead of the sparseM package I use the Matrix package to build the sparse matrices. Store the entries and columns in separate lists and then build the matrix by:
```
data=sparseMatrix(i=rep(1,length[[1]]),j=columns[[loop]],
x=entires[[loop]],dims=c(120000,47235))
for(... | null | CC BY-SA 2.5 | null | 2011-02-01T18:58:10.837 | 2011-02-01T18:58:10.837 | null | null | 2310 | null |
6790 | 2 | null | 6787 | 4 | null | I would recommend looking at the [snpMatrix](http://www.bioconductor.org/packages/2.3/bioc/html/snpMatrix.html) R package. Within the `snp.lhs.tests()` function, height will be the phenotype (or outcome), your SNP data will be stored in a vector (`snp.data`), and your gene expression levels will enter the model as cova... | null | CC BY-SA 2.5 | null | 2011-02-01T22:15:50.637 | 2011-02-01T22:15:50.637 | null | null | 930 | null |
6791 | 1 | 6797 | null | 8 | 11146 | Let Year 1 be last year's data and Year 2 be this year's data.
Suppose that in Year 1, you had a likert scale that was 1-9 (Categorical/Ordinal) and that in Year 2, for the same question you had a likert scale that was 1-5 (Categorical/Ordinal).
What would be some of the things that you would try (if at all) to compa... | How to compare Likert scales with varying number of categories across time? | CC BY-SA 2.5 | null | 2011-02-01T23:36:42.177 | 2023-04-13T11:04:09.670 | 2011-03-30T18:42:33.780 | 930 | 776 | [
"scales",
"likert"
] |
6793 | 2 | null | 6762 | 5 | null | Below, I briefly sketch out one "back of the envelope" calculation, which is in no way optimal, but does at least show that the probability converges to one exponentially fast. Before getting into the (gory) details, we give the answer.
$$
\Pr(\text{at least one actor chooses a unique outcome}) \geq 1 - (e/4)^{n/2} .
... | null | CC BY-SA 2.5 | null | 2011-02-02T02:44:08.977 | 2011-02-06T14:48:56.133 | 2011-02-06T14:48:56.133 | 2970 | 2970 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.