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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6464 | 2 | null | 6463 | 3 | null | You should try R software with package [spdep](http://cran.r-project.org/web/packages/spdep/index.html). see the vignette [here](http://cran.r-project.org/web/packages/spdep/vignettes/sids.pdf)
| null | CC BY-SA 2.5 | null | 2011-01-23T08:13:06.243 | 2011-01-23T09:26:32.053 | 2011-01-23T09:26:32.053 | 930 | 223 | null |
6465 | 2 | null | 6463 | 13 | null | In addition to the package that @robin pointed too, you should look at the [Spatial](http://cran.r-project.org/web/views/Spatial.html) Task View on CRAN. What you are describing is known as a [choropleth map](http://en.wikipedia.org/wiki/Choropleth_map), as illustrated here: [Choropleth Maps of Presidential Voting](htt... | null | CC BY-SA 2.5 | null | 2011-01-23T09:26:00.510 | 2011-01-23T09:26:00.510 | null | null | 930 | null |
6466 | 2 | null | 577 | 6 | null | AIC should rarely be used, as it is really only valid asymptotically. It is almost always better to use AICc (AIC with a correction for finite sample size). AIC tends to overparameterize: that problem is greatly lessened with AICc. The main exception to using AICc is when the underlying distributions are heavily lep... | null | CC BY-SA 2.5 | null | 2011-01-23T14:11:09.733 | 2011-01-23T14:11:09.733 | null | null | 2875 | null |
6467 | 2 | null | 6463 | 2 | null | I've not tried [CrackMaps](http://www.crack4mac.com/) but it looks very interesting. Only available for the Mac, I presume.
| null | CC BY-SA 2.5 | null | 2011-01-23T14:31:32.623 | 2011-01-23T14:31:32.623 | null | null | 2617 | null |
6468 | 1 | null | null | 3 | 934 | This is a question that landed on my desk, and I don't have the requisite experience to reply.
A researcher has been asked to perform (by a journal reviewer) a two-way factorial ANCOVA on some microrarray data (a single array will be a single measurement of ~30,000 entities from a single sample in this case).
The sugge... | Requirements to perform a two-way factorial ANCOVA | CC BY-SA 2.5 | null | 2011-01-23T15:16:47.363 | 2011-01-23T17:48:31.583 | null | null | null | [
"ancova"
] |
6469 | 1 | 6470 | null | 21 | 24393 | How do I fit a linear model with autocorrelated errors in R? In stata I would use the `prais` command, but I can't find an R equivalent...
| Simple linear model with autocorrelated errors in R | CC BY-SA 2.5 | null | 2011-01-23T15:36:47.640 | 2015-02-17T08:58:47.903 | 2011-01-23T17:35:50.843 | null | 2817 | [
"r",
"time-series",
"autocorrelation"
] |
6470 | 2 | null | 6469 | 24 | null | Have a look at `gls` (generalized least squares) from the package [nlme](http://cran.r-project.org/web/packages/nlme/index.html)
You can set a correlation profile for the errors in the regression, e.g. ARMA, etc:
```
gls(Y ~ X, correlation=corARMA(p=1,q=1))
```
for ARMA(1,1) errors.
| null | CC BY-SA 2.5 | null | 2011-01-23T15:52:41.160 | 2011-01-23T15:52:41.160 | null | null | 300 | null |
6471 | 2 | null | 6469 | 7 | null | Use function gls from package nlme. Here is the example.
```
##Generate data frame with regressor and AR(1) error. The error term is
## \eps_t=0.3*\eps_{t-1}+v_t
df <- data.frame(x1=rnorm(100), err=filter(rnorm(100)/5,filter=0.3,method="recursive"))
##Create ther response
df$y <- 1 + 2*df$x + df$err
###Fit the model... | null | CC BY-SA 2.5 | null | 2011-01-23T16:11:36.907 | 2011-01-23T18:56:29.413 | 2011-01-23T18:56:29.413 | 2116 | 2116 | null |
6472 | 2 | null | 6468 | 2 | null | A total sample size of nine is simply too small to do a two-way factorial ANCOVA or a two way-factorial ANOVA. I would have thought it's stretching things to even do a one-way ANOVA on nine observations, especially with 30,000 different outcomes. I think you need a bigger sample if you wish to make any statistical infe... | null | CC BY-SA 2.5 | null | 2011-01-23T17:48:31.583 | 2011-01-23T17:48:31.583 | null | null | 449 | null |
6473 | 1 | 6474 | null | 8 | 2822 | I was wondering if anyone has ported the examples from Durbin & Koopman "Time Series Analysis by State Space Methods" to R?
You can find RATS code for the examples online and obviosly SsfPack/Ox but no signs of an R companion for this book...
| R examples for Durbin & Koopman "Time Series Analysis by State Space Methods" | CC BY-SA 2.5 | null | 2011-01-23T18:44:29.417 | 2018-05-15T08:16:24.717 | 2018-05-15T07:26:50.410 | 128677 | 300 | [
"r",
"time-series",
"references",
"state-space-models"
] |
6474 | 2 | null | 6473 | 15 | null | There is a package in CRAN ([KFAS](http://cran.r-project.org/web/packages/KFAS/index.html)) which implements a good portion of the algorithms described in Durbin & Koopman, including "exact" non-informative distributions for the state vector, or parts of it.
Although it is not paticularly tied to Durbin & Koopman's boo... | null | CC BY-SA 2.5 | null | 2011-01-23T18:53:28.767 | 2011-01-23T18:53:28.767 | null | null | 892 | null |
6475 | 1 | 6491 | null | 4 | 6768 | I have used a three-way ANOVA to analyze the the effect of genes, transcription factors, and different conditions on the gene expression. Now I have 9 elements, SSa, SSb, SSc, SSab, SSbc, SSac, SSabc, SSe. How can I interpret these values? I appreciate if you introduce me some resources, or share your own experience wi... | How to interpret a three-way ANOVA? | CC BY-SA 2.5 | null | 2011-01-23T19:48:59.000 | 2011-01-24T16:01:01.520 | 2011-01-23T19:55:49.120 | 930 | 2885 | [
"anova",
"interpretation"
] |
6476 | 2 | null | 6469 | 30 | null | In addition to the `gls()` function from `nlme`, you can also use the `arima()` function in the `stats` package using MLE. Here is an example with both functions.
```
x <- 1:100
e <- 25*arima.sim(model=list(ar=0.3),n=100)
y <- 1 + 2*x + e
###Fit the model using gls()
require(nlme)
(fit1 <- gls(y~x, corr=corAR1(0.5,for... | null | CC BY-SA 2.5 | null | 2011-01-23T21:22:19.533 | 2011-01-24T04:48:03.363 | 2011-01-24T04:48:03.363 | 159 | 159 | null |
6477 | 1 | 6486 | null | 13 | 36377 | I have run Levene's and Bartlett's test on groups of data from one of my experiments to validate that I am not violating ANOVA's assumption of homogeneity of variances. I'd like to check with you guys that I'm not making any wrong assumptions, if you don't mind :D
The p-value returned by both of those tests is the prob... | Interpretation of the p-values produced by Levene's or Bartlett's test for homogeneity of variances | CC BY-SA 2.5 | null | 2011-01-23T21:42:19.447 | 2011-01-24T15:20:28.567 | 2011-01-23T23:15:38.383 | 1320 | 1320 | [
"anova",
"heteroscedasticity",
"levenes-test"
] |
6478 | 1 | 6485 | null | 30 | 68051 | When building a CART model (specifically classification tree) using rpart (in R), it is often interesting to know what is the importance of the various variables introduced to the model.
Thus, my question is: What common measures exists for ranking/measuring variable importance of participating variables in a CART mod... | How to measure/rank "variable importance" when using CART? (specifically using {rpart} from R) | CC BY-SA 2.5 | null | 2011-01-23T22:06:03.373 | 2023-03-20T01:50:42.053 | 2011-01-27T10:42:22.663 | 8 | 253 | [
"r",
"classification",
"model-selection",
"cart",
"rpart"
] |
6479 | 2 | null | 6477 | 5 | null | You're on "the right side of the p-value." I'd just adjust your statement slightly to say that, IF the groups had equal variances in their populations, this result of p=0.95 indicates that random sampling using these n-sizes would produce variances this far apart or farther 95% of the time. In other words, strictly s... | null | CC BY-SA 2.5 | null | 2011-01-23T22:20:05.120 | 2011-01-23T22:39:18.393 | 2011-01-23T22:39:18.393 | 2669 | 2669 | null |
6480 | 1 | 6482 | null | 7 | 323 | I have run 10,000 random samples (910 data points each) on a data set of about 75,000 data points. I would like to make a continuous distribution out of this so that I can test the probability of getting the results of a particular non-random sample which I made based on theoretical concerns.
For each random sample (a... | How can I make a continuous distribution out of simulation results in R? | CC BY-SA 2.5 | null | 2011-01-24T00:56:13.530 | 2011-01-24T18:42:45.843 | 2011-01-24T09:37:48.097 | 144 | 52 | [
"r",
"distributions",
"simulation"
] |
6481 | 1 | 6510 | null | 3 | 349 | As the title suggests, I am hesitating on whether to use ordinal logistic regression or not. I don't think I have the time to understand that and to figure out how to work it out in R, so can I just ignore it? Will the consequences be serious (i.e. seriously under/over-estimate the effect size)?
Thanks.
| Consequence of ignoring the order of a categorical variable with different levels in logistic regression | CC BY-SA 3.0 | 0 | 2011-01-24T06:40:36.760 | 2015-05-20T14:38:44.167 | 2015-05-20T14:38:44.167 | 28740 | 588 | [
"logistic",
"ordinal-data"
] |
6482 | 2 | null | 6480 | 3 | null | It sounds like what you're describing is a bootstrap simulation in order to estimate the distribution of a statistic (the relative frequencies).
The package I'd suggest you to look into is the [boot package:](http://cran.r-project.org/web/packages/boot/index.html)
>
functions and datasets for
bootstrapping from the ... | null | CC BY-SA 2.5 | null | 2011-01-24T07:42:57.160 | 2011-01-24T07:42:57.160 | null | null | 253 | null |
6483 | 1 | null | null | 7 | 377 | I've items that have a geo-spatial position and a temporal origin. For both dimensions, I build clusters so far.
I'm now in search of a way to merge this different clusters forming spatio-temporal clusters. Of course, I want to prevent calculating completely new clusters from the scratch and rather use the existing inf... | Merging spatial and temporal clusters | CC BY-SA 2.5 | null | 2011-01-24T07:48:41.997 | 2011-06-02T22:31:51.410 | 2011-01-24T19:33:04.137 | 919 | 2880 | [
"time-series",
"clustering",
"spatial"
] |
6484 | 1 | null | null | 1 | 2537 | I am using binary logistic regression to test this model:
$\text{logit}(\rho_1) = \alpha + \beta_1(\text{INDDIR}) + \beta_2(\text{INDCHAIR}) + \beta_3(\text{BOARDSIZE}) +\\ \beta_4(\text{DIRSHIP}) + \beta_5(\text{MEETING}) + \beta_6(\text{EXPERT}) + \beta_7(\text{INSTI}) +\\ \beta_8(\text{DEBT}) + \beta_9(\text{LnSIZE... | Problem with casewise list in logistic regression | CC BY-SA 4.0 | null | 2011-01-24T09:23:24.853 | 2020-01-30T07:30:17.283 | 2020-01-30T07:30:17.283 | 143489 | 2793 | [
"logistic",
"spss"
] |
6485 | 2 | null | 6478 | 48 | null | Variable importance might generally be computed based on the corresponding reduction of predictive accuracy when the predictor of interest is removed (with a permutation technique, like in Random Forest) or some measure of decrease of node impurity, but see (1) for an overview of available methods. An obvious alternati... | null | CC BY-SA 2.5 | null | 2011-01-24T10:47:25.223 | 2011-01-24T10:47:25.223 | null | null | 930 | null |
6486 | 2 | null | 6477 | 8 | null | The p-value of your significance test can be interpreted as the probability of observing the value of the relevant statistic as or more extreme than the value you actually observed, given that the null hypothesis is true. (note that the p-value makes no reference to what values of the statistic are likely under the al... | null | CC BY-SA 2.5 | null | 2011-01-24T12:53:41.863 | 2011-01-24T14:56:01.570 | 2011-01-24T14:56:01.570 | 2392 | 2392 | null |
6487 | 1 | null | null | 1 | 2501 | Looking to estimate a `VARX(p,q)` type VECM in R if possible.
I'd like to estimate a VECM with p lags (lags relative to the level, not diff of the vars) on the endogenous variables and q lags on the exogenous components. Any ideas? At the moment I'm using the `ca.jo()` function and adding the contemporaneous and lag... | Lagged Exogenous Variables in VECM with R | CC BY-SA 2.5 | null | 2011-01-24T13:12:50.933 | 2011-01-24T15:23:46.473 | 2011-01-24T15:23:46.473 | null | null | [
"r",
"time-series",
"cointegration"
] |
6488 | 2 | null | 6487 | 4 | null | If your variables are exogenous and their lags are exogenous, then there is no problem in treating them as dummy variables. So you can add them to `dumvar` option. My answer [to similar question](https://stats.stackexchange.com/questions/4030/finding-coefficients-for-vecm-exogenous-variables/5291#5291) applies.
| null | CC BY-SA 2.5 | null | 2011-01-24T13:23:25.360 | 2011-01-24T13:23:25.360 | 2017-04-13T12:44:52.277 | -1 | 2116 | null |
6489 | 2 | null | 2950 | 0 | null | I wouldnt cluster or classify the data at all. Since youve got ratio scaled data (isotopes) my method of choice would be PCA (Principal Component Analysis). By colouring your points in the PCA diagram according to your "eco-type" you could see their dispersal within the isotope ratio variation. Further, you will see th... | null | CC BY-SA 2.5 | null | 2011-01-24T15:19:25.240 | 2011-01-24T15:19:25.240 | null | null | null | null |
6490 | 2 | null | 6477 | 3 | null | While the previous comments are 100% correct, the plots produced for model objects in R provide a graphic summary of this question. Personally, i always find the plots much more useful than the p value, as one can transform the data afterward and spot the changes immediately in the plot.
| null | CC BY-SA 2.5 | null | 2011-01-24T15:20:28.567 | 2011-01-24T15:20:28.567 | null | null | 656 | null |
6491 | 2 | null | 6475 | 2 | null | Just a (not so) brief note on the question as posed, before I give a way to intepret, you must be careful about which sums of squares you have calculated, for they relate to different kinds of null hypothesis. For example, the term $SSa$ may be for just the effect $a$ assuming everything else is in the model, or it ma... | null | CC BY-SA 2.5 | null | 2011-01-24T16:01:01.520 | 2011-01-24T16:01:01.520 | null | null | 2392 | null |
6492 | 1 | 6679 | null | 16 | 3184 | I want to use a t distribution to model short interval asset returns in a bayesian model. I'd like to estimate both the degrees of freedom (along with other parameters in my model) for the distribution. I know that asset returns are quite non-normal, but I don't know too much beyond that.
What is an appropriate, mildl... | What's a good prior distribution for degrees of freedom in a t distribution? | CC BY-SA 2.5 | null | 2011-01-24T17:55:40.930 | 2020-02-26T16:49:59.363 | 2011-01-24T18:03:05.840 | 1146 | 1146 | [
"distributions",
"bayesian",
"modeling",
"prior"
] |
6493 | 1 | 6506 | null | 24 | 6795 | I have been using log normal distributions as prior distributions for scale parameters (for normal distributions, t distributions etc.) when I have a rough idea about what the scale should be, but want to err on the side of saying I don't know much about it. I use it because the that use makes intuitive sense to me, bu... | Weakly informative prior distributions for scale parameters | CC BY-SA 3.0 | null | 2011-01-24T18:02:29.257 | 2020-05-11T11:12:51.243 | 2013-01-24T18:08:12.653 | 1146 | 1146 | [
"distributions",
"bayesian",
"modeling",
"prior",
"maximum-entropy"
] |
6494 | 2 | null | 6480 | 2 | null | Sounds like you want something like a [Kernel Density Estimate](http://en.wikipedia.org/wiki/Kernel_density_estimation) of the distribution. In R I think you want [density](http://stat.ethz.ch/R-manual/R-patched/library/stats/html/density.html) function.
| null | CC BY-SA 2.5 | null | 2011-01-24T18:42:45.843 | 2011-01-24T18:42:45.843 | null | null | 1146 | null |
6496 | 2 | null | 6463 | 3 | null | Self promotion: [JMP](http://www.jmp.com) (commercial desktop software) does choropleths of US states, US counties, world countries and regions of select other countries.
| null | CC BY-SA 2.5 | null | 2011-01-24T19:35:16.437 | 2011-01-24T19:35:16.437 | null | null | 1191 | null |
6498 | 1 | 6503 | null | 26 | 6698 | This may be hard to find, but I'd like to read a well-explained ARIMA example that
- uses minimal math
- extends the discussion beyond building a model into using that model to forecast specific cases
- uses graphics as well as numerical results to characterize the fit between forecasted and actual values.
| Seeking certain type of ARIMA explanation | CC BY-SA 2.5 | null | 2011-01-25T02:19:35.050 | 2017-07-14T08:51:15.390 | 2017-07-14T08:51:15.390 | 11887 | 2669 | [
"time-series",
"arima",
"intuition"
] |
6499 | 1 | 6548 | null | 7 | 1366 | Assume I have a random vector $X = \{x_1, x_2, ..., x_N\}$, composed of i.i.d. binomially distributed values. If it would simplify the problem substantially, we can approximate them as normally distributed. Given that all other parameters are fixed, I want to know how $E[min(X)]$ (the expected value of the smallest n... | How do extreme values scale with sample size? | CC BY-SA 2.5 | null | 2011-01-25T04:16:28.640 | 2011-01-27T20:44:19.810 | 2011-01-25T04:23:44.263 | 1347 | 1347 | [
"binomial-distribution",
"normal-distribution",
"approximation",
"extreme-value"
] |
6500 | 2 | null | 6498 | 15 | null | I tried to do that in chapter 7 of my [1998 textbook](http://robjhyndman.com/forecasting/) with Makridakis & Wheelwright. Whether I succeeded or not I'll leave others to judge. You can read some of the chapter online via [Amazon](http://rads.stackoverflow.com/amzn/click/0471532339) (from p311). Search for "ARIMA" in th... | null | CC BY-SA 3.0 | null | 2011-01-25T04:27:55.573 | 2012-05-17T22:14:08.437 | 2012-05-17T22:14:08.437 | 159 | 159 | null |
6501 | 2 | null | 6353 | 1 | null | A simple way to turn categorical variables into a set of dummy variables for use in models in SPSS is using the do repeat syntax. This is the simplest to use if your categorical variables are in numeric order.
```
*making vector of dummy variables.
vector dummy(3,F1.0).
*looping through dummy variables using do repeat,... | null | CC BY-SA 2.5 | null | 2011-01-25T04:29:36.703 | 2011-01-25T04:29:36.703 | null | null | 1036 | null |
6502 | 1 | 6512 | null | 18 | 6193 | In a LASSO regression scenario where
$y= X \beta + \epsilon$,
and the LASSO estimates are given by the following optimization problem
$ \min_\beta ||y - X \beta|| + \tau||\beta||_1$
Are there any distributional assumptions regarding the $\epsilon$?
In an OLS scenario, one would expect that the $\epsilon$ are independe... | LASSO assumptions | CC BY-SA 2.5 | null | 2011-01-25T04:55:04.823 | 2012-10-18T07:53:30.350 | null | null | 2902 | [
"regression",
"lasso",
"assumptions",
"residuals"
] |
6503 | 2 | null | 6498 | 7 | null | My suggested reading for an intro to ARIMA modelling would be
[Applied Time Series Analysis for the Social Sciences](http://books.google.com/books?id=D6-CAAAAIAAJ&q=Applied+Time+Series+Analysis+for+the+Social+Sciences&dq=Applied+Time+Series+Analysis+for+the+Social+Sciences&hl=en&ei=QaLNTKD-HcH88Aabt-Al&sa=X&oi=book_res... | null | CC BY-SA 2.5 | null | 2011-01-25T05:14:30.753 | 2011-01-25T05:24:27.843 | 2011-01-25T05:24:27.843 | 1036 | 1036 | null |
6504 | 2 | null | 5831 | 4 | null | You might check out a recent presentation on SSRN by Bernard Black, "Bloopers: How (Mostly) Smart People Get Causal Inference Wrong."
[http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1663404](http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1663404)
I will say that I also admire David Freedman and appreciate his w... | null | CC BY-SA 3.0 | null | 2011-01-25T05:38:56.410 | 2016-12-20T18:33:39.523 | 2016-12-20T18:33:39.523 | 22468 | 401 | null |
6505 | 1 | 6511 | null | 34 | 183614 | Suppose I am going to do a univariate logistic regression on several independent variables, like this:
```
mod.a <- glm(x ~ a, data=z, family=binominal("logistic"))
mod.b <- glm(x ~ b, data=z, family=binominal("logistic"))
```
I did a model comparison (likelihood ratio test) to see if the model is better than the null... | Likelihood ratio test in R | CC BY-SA 3.0 | null | 2011-01-25T05:51:13.933 | 2019-08-25T13:42:30.850 | 2015-12-17T13:52:34.487 | 25741 | 588 | [
"r",
"logistic",
"diagnostic"
] |
6506 | 2 | null | 6493 | 23 | null | I would recommend using a "Beta distribution of the second kind" (Beta2 for short) for a mildly informative distribution, and to use the conjugate inverse gamma distribution if you have strong prior beliefs. The reason I say this is that the conjugate prior is non-robust in the sense that, if the prior and data confli... | null | CC BY-SA 4.0 | null | 2011-01-25T06:05:53.627 | 2020-05-11T11:12:51.243 | 2020-05-11T11:12:51.243 | 58887 | 2392 | null |
6507 | 2 | null | 6499 | 1 | null | The distribution of the minimum of any set of N iid random variables is:
$$f_{min}(x)=Nf(x)[1-F(x)]^{N-1}$$
Where $f(x)$ is the pdf and $F(x)$ is the cdf (this is sometime called a $Beta-F$ distribution, because it is a compound of a Beta distribution and an arbitrary distribution). Hence the expectation (in this part... | null | CC BY-SA 2.5 | null | 2011-01-25T07:00:26.590 | 2011-01-25T23:25:12.873 | 2011-01-25T23:25:12.873 | 2392 | 2392 | null |
6508 | 2 | null | 5327 | 7 | null | If we go for a simple answer, the excerpt from the [Wooldridge book](http://books.google.com/books?id=cdBPOJUP4VsC&printsec=frontcover&dq=wooldridge+econometrics&hl=fr&ei=1HM-TfauIIfqOZqBqY8L&sa=X&oi=book_result&ct=result&resnum=2&ved=0CC8Q6AEwAQ#v=onepage&q=wooldridge%20econometrics&f=false) (page 533) is very appropr... | null | CC BY-SA 2.5 | null | 2011-01-25T07:03:46.943 | 2011-01-25T07:03:46.943 | null | null | 2116 | null |
6509 | 2 | null | 6499 | 2 | null | The table in [this page](http://books.google.com/books?id=dVP-RTea5wcC&lpg=PP1&dq=a%20first%20course%20in%20order%20statistics&hl=fr&pg=PA69#v=onepage&q&f=false) of [this book](http://books.google.com/books?id=dVP-RTea5wcC&printsec=frontcover&dq=a+first+course+in+order+statistics&hl=fr&ei=93s-TaLkGZOWsgOvyOWkBQ&sa=X&oi... | null | CC BY-SA 2.5 | null | 2011-01-25T07:31:29.650 | 2011-01-25T07:31:29.650 | null | null | 2116 | null |
6510 | 2 | null | 6481 | 2 | null | If you need to quickly use an ordinal variable as an input, I recommend using it as a factor. The order of the factor is important for the interpretation of the results, but it's rather simple to reorder to the factor (using the factor command). The way the results are reported is the first group in the factor is held ... | null | CC BY-SA 2.5 | null | 2011-01-25T07:48:25.753 | 2011-01-25T07:54:33.577 | 2011-01-25T07:54:33.577 | 2166 | 2166 | null |
6511 | 2 | null | 6505 | 30 | null | Basically, yes, provided you use the correct difference in log-likelihood:
```
> library(epicalc)
> model0 <- glm(case ~ induced + spontaneous, family=binomial, data=infert)
> model1 <- glm(case ~ induced, family=binomial, data=infert)
> lrtest (model0, model1)
Likelihood ratio test for MLE method
Chi-squared 1 d.f. =... | null | CC BY-SA 2.5 | null | 2011-01-25T08:01:14.260 | 2011-01-25T08:01:14.260 | null | null | 930 | null |
6512 | 2 | null | 6502 | 16 | null | I am not an expert on LASSO, but here is my take.
First note that OLS is pretty robust to violations of indepence and normality. Then judging from the Theorem 7 and the discussion above it in the article [Robust Regression and Lasso](http://arxiv.org/pdf/0811.1790.pdf) (by X. Huan, C. Caramanis and S. Mannor) I guess... | null | CC BY-SA 3.0 | null | 2011-01-25T08:13:53.123 | 2012-10-18T07:53:30.350 | 2012-10-18T07:53:30.350 | 2116 | 2116 | null |
6513 | 1 | 6539 | null | 7 | 5984 | I want to predict inter-day electricity load. My data are electricity loads for 11 months, sampled in 30 minute intervals. I also got the weather-specific data from a meteorological station (temperature, relative humidity, wind direction, wind speed, sunlight). From this, I want to predict the electricity load until th... | Predicting daily electricity load - fitting time series | CC BY-SA 2.5 | null | 2011-01-25T08:17:54.077 | 2015-01-14T12:33:46.350 | null | null | 2889 | [
"r",
"time-series",
"regression",
"predictive-models",
"arima"
] |
6515 | 2 | null | 6505 | 29 | null | An alternative is the `lmtest` package, which has an `lrtest()` function which accepts a single model. Here is the example from `?lrtest` in the `lmtest` package, which is for an LM but there are methods that work with GLMs:
```
> require(lmtest)
Loading required package: lmtest
Loading required package: zoo
> ## with ... | null | CC BY-SA 2.5 | null | 2011-01-25T08:49:04.917 | 2011-01-25T08:49:04.917 | null | null | 1390 | null |
6516 | 1 | null | null | 5 | 296 | I'm currently working on audio data trying to perform a recognition for given classes (for example grinding coffee etc.). However, I have some trouble distinguishing the null class from interesting sound segments.
Currently, I simply look at the audio intensity. As I have a limited, known number of classes I want to de... | Ideas for Segmenting Audio Data | CC BY-SA 2.5 | null | 2011-01-25T09:44:42.360 | 2011-01-25T15:11:37.393 | null | null | 2904 | [
"machine-learning"
] |
6517 | 2 | null | 6516 | 2 | null | There are interesting ideas you have already started to dig in. You should just dig a little more.
- Using decomposition on a meaningfull basis like fft or wavelet transform is interesting. This is alternative representation. You can think of a lot of alternative representations... wavelet is my favorite for audio da... | null | CC BY-SA 2.5 | null | 2011-01-25T10:33:14.700 | 2011-01-25T10:33:14.700 | null | null | 223 | null |
6518 | 1 | 6523 | null | 17 | 394 | Has anyone written a brief survey of the various approaches to statistics? To a first approximation you have frequentist and Bayesian statistics. But when you look closer you also have other approaches like likelihoodist and empirical Bayes. And then you have subdivisions within groups such as subjective Bayes objectiv... | Statistical landscape | CC BY-SA 2.5 | null | 2011-01-25T11:40:59.857 | 2011-01-27T21:06:54.677 | 2011-01-27T21:06:54.677 | 319 | 319 | [
"bayesian",
"frequentist",
"philosophical"
] |
6519 | 1 | null | null | 3 | 253 | We are measuring data with a high sample rate (20 kHz) and calculated a big standard error due to our system setup. Currently we are only interested in slow signals (in the order of Hz's) is it valid to use averaging (once per 20.000 samples) and thus lower our standard error with an order 20.000?
| What does averaging do for the noise level of my signal | CC BY-SA 2.5 | null | 2011-01-25T12:11:54.427 | 2011-01-25T16:32:18.687 | null | null | 2907 | [
"standard-error",
"measurement"
] |
6520 | 1 | 6522 | null | 5 | 439 | I have 100 geographical regions in a country. For each region the total number of houses and the number of vacant houses have been collected yearly over 20 years. I have also some other economic indicators at the country level (GDP, interest rate etc.). Now, given the forecasts for these indicators for next year, I wan... | Modeling vacancy rate | CC BY-SA 2.5 | null | 2011-01-25T12:26:40.787 | 2011-02-07T09:08:55.787 | 2011-02-07T09:08:55.787 | 1443 | 1443 | [
"time-series",
"mixed-model",
"forecasting"
] |
6521 | 2 | null | 6520 | 3 | null | It would seem to make sense to use a generalized linear mixed model with `family=binomial` and a logit or probit link. This would restrict your fitted values to the range (0,1). I don't know whether you can combine that with an autoregressive error structure in `lmer4` though.
| null | CC BY-SA 2.5 | null | 2011-01-25T12:43:29.727 | 2011-01-25T12:43:29.727 | null | null | 449 | null |
6522 | 2 | null | 6520 | 4 | null | One of the tricks in modelling percentages is to use the [logit transformation](http://en.wikipedia.org/wiki/Logit). Then instead of modelling percentage $p_i$ as linear function you model the logit transform of this percentage:
\begin{align}
y_i=\log\frac{p_i}{1-p_i}
\end{align}
In R you will need to create new transf... | null | CC BY-SA 2.5 | null | 2011-01-25T12:53:36.730 | 2011-01-25T12:53:36.730 | null | null | 2116 | null |
6523 | 2 | null | 6518 | 5 | null | Here's one I found via a Google Image search, but maybe it's too brief, and the diagram too simple: [http://labstats.net/articles/overview.html](http://labstats.net/articles/overview.html)
| null | CC BY-SA 2.5 | null | 2011-01-25T13:11:39.397 | 2011-01-25T13:11:39.397 | null | null | 449 | null |
6524 | 1 | null | null | -1 | 2200 | fT(t;B,C) = exp(-t/C)-exp(-t/B) / C-B where our mean is C+B and t>0.
so far i have found my log likelihood functions and differentiated them as follows:
dl/dB = sum[t*exp(t/C) / (B^2(exp(t/c)-exp(t/B)))] +n/(C-B) = 0
i have also found a similar dl/dC.
I have now been asked to comment what you can find in the way of suf... | Maximum likelihood and sufficient statistics | CC BY-SA 2.5 | null | 2011-01-25T13:28:53.477 | 2018-03-15T23:58:18.083 | 2011-01-25T14:36:03.493 | 449 | 2908 | [
"self-study",
"maximum-likelihood"
] |
6525 | 1 | null | null | 2 | 545 | I'm very new to R Programming. So please excuse for such a simple doubt.

I want to plot the above graph. The x & y values are sequence from 0 to 2560. I want plot a a curve on the points where x*y=10^6.
What are the line required in R Programming Lan... | How can I plot this simple graph (Refer Image) in R? | CC BY-SA 2.5 | 0 | 2011-01-25T13:59:38.873 | 2011-01-25T15:18:53.783 | 2011-01-25T14:54:24.167 | 1706 | 1706 | [
"r"
] |
6526 | 2 | null | 6518 | 7 | null | Here's a longer article. No diagram and isn't exactly a survey, more, as the abstract puts it, of 'an idiosyncratic walk through some of these issues':
M. J. Bayarri and J. O. Berger (2004). ["The Interplay of Bayesian and Frequentist Analysis"](http://www.jstor.org/stable/4144373). Statistical Science 19 (1):58-80.
(... | null | CC BY-SA 2.5 | null | 2011-01-25T14:00:23.943 | 2011-01-25T14:00:23.943 | null | null | 449 | null |
6527 | 2 | null | 6525 | 7 | null | I think all you need is:
```
curve(1e6/x,0,2560)
```
EDIT in light of comments:
Or perhaps:
```
plot(...<your data>...)
curve(1e6/x, 1e6/2560,2560, add=TRUE)
```
| null | CC BY-SA 2.5 | null | 2011-01-25T14:08:35.037 | 2011-01-25T15:18:53.783 | 2011-01-25T15:18:53.783 | 449 | 449 | null |
6528 | 2 | null | 6525 | 0 | null | The easiest way is to compute all y values at every given x values, like:
```
df <- data.frame(x=1:2560)
df$y <- 10^6/df$x
# the latter equivalent to:
# df <- within(df,y<-10^6/x)
```
And after plot the dataframe:
```
plot(df, type="l", main=expression(f(x) == frac(10^{6},x)))
```
 and to bui... | null | CC BY-SA 2.5 | null | 2011-01-25T14:15:47.943 | 2011-01-25T14:15:47.943 | null | null | 2645 | null |
6530 | 2 | null | 6519 | 2 | null | Averaging is just a low pass filter so if you want to filter out the high frequency component of your signal, it will do that.
Obviously different averaging techniques and different parameters will filter out high frequency components in a different way. See for instance [this illustration of the frequency response of ... | null | CC BY-SA 2.5 | null | 2011-01-25T14:57:37.033 | 2011-01-25T14:57:37.033 | null | null | 300 | null |
6531 | 2 | null | 6516 | 1 | null | I think the R package [rggobi](http://www.ggobi.org/rggobi/introduction.pdf) is exactly what you're looking for. Audo recognition is even their [example problem](http://www.ggobi.org/book/2007-infovis/05-clustering.pdf)!
| null | CC BY-SA 2.5 | null | 2011-01-25T15:11:37.393 | 2011-01-25T15:11:37.393 | null | null | 2817 | null |
6532 | 2 | null | 6483 | 2 | null | I don’t know if I understood your question correctly, but I’ll give it a try.
Any hierarchical agglomerative algorithm can do the job. Remember that agglomerative algorithms proceed by “pasting” observations to a cluster and treating the cluster as a single unit.
I would suggest this:
- Substitute your 1d or 2d obse... | null | CC BY-SA 2.5 | null | 2011-01-25T16:14:11.083 | 2011-01-25T16:19:54.587 | 2011-01-25T16:19:54.587 | 2902 | 2902 | null |
6533 | 2 | null | 6519 | 2 | null | Yes, you can reduce the noise by averaging or in general by reducing the sampling rate of the signal. This is a very common technique in signal processing commonly refereed to as [oversampling](http://en.wikipedia.org/wiki/Oversampling). It is widely used in sigma-delta converters. Oversampling basically means that the... | null | CC BY-SA 2.5 | null | 2011-01-25T16:32:18.687 | 2011-01-25T16:32:18.687 | null | null | 2020 | null |
6534 | 1 | 6536 | null | 35 | 226650 | So, I have a data set of percentages like so:
```
100 / 10000 = 1% (0.01)
2 / 5 = 40% (0.4)
4 / 3 = 133% (1.3)
1000 / 2000 = 50% (0.5)
```
I want to find the standard deviation of the percentages, but weighted for their data volume. ie, the first and last data points should dominat... | How do I calculate a weighted standard deviation? In Excel? | CC BY-SA 2.5 | null | 2011-01-25T16:44:25.457 | 2020-05-27T18:11:44.207 | 2011-01-25T23:42:29.083 | 142 | 142 | [
"standard-deviation",
"excel",
"weighted-mean"
] |
6535 | 1 | null | null | 4 | 354 | Is there any downside to using a repeated-measure ANOVA when you have a within-subjects 2-level factor where 1 level is represented by more trials than the other. I know in ANOVA we are comparing means, but does the the tighter standard error on the one level throw off the ANOVA? For example, if my IV is stimulus cong... | Does a within-subjects factor with unequally represented levels mess up a repeated-measures ANOVA? | CC BY-SA 2.5 | null | 2011-01-25T17:06:41.823 | 2011-01-25T19:52:40.277 | 2011-01-25T19:52:40.277 | 2322 | 2322 | [
"anova",
"repeated-measures",
"standard-error"
] |
6536 | 2 | null | 6534 | 47 | null | The [formula for weighted standard deviation](http://www.itl.nist.gov/div898/software/dataplot/refman2/ch2/weightsd.pdf) is:
$$ \sqrt{ \frac{ \sum_{i=1}^N w_i (x_i - \bar{x}^*)^2 }{ \frac{(M-1)}{M} \sum_{i=1}^N w_i } },$$
where
$N$ is the number of observations.
$M$ is the number of nonzero weights.
$w_i$ are the weigh... | null | CC BY-SA 3.0 | null | 2011-01-25T18:22:20.437 | 2013-07-31T11:13:57.223 | 2013-07-31T11:13:57.223 | 28661 | 2902 | null |
6537 | 2 | null | 6535 | 2 | null | I think there are ways to do unbalanced repeated measures ANOVA; maybe look at the books "Variance Components" by Searle, Casella, and McCulloch, and "Components of Variance" by Cox and Solomon. It also seems to be in some books about multilevel / hierarchical / mixed effect models (e.g. Raudenbush and Bryk), where it ... | null | CC BY-SA 2.5 | null | 2011-01-25T18:58:46.707 | 2011-01-25T18:58:46.707 | null | null | 2739 | null |
6538 | 1 | null | null | 86 | 13373 | I know people love to close duplicates so I am not asking for a reference to start learning statistics (as [here](https://stats.stackexchange.com/questions/414/introduction-to-statistics-for-mathematicians)).
I have a doctorate in mathematics but never learned statistics. What is the shortest route to the equivalent k... | Mathematician wants the equivalent knowledge to a quality stats degree | CC BY-SA 3.0 | null | 2011-01-25T19:03:49.097 | 2018-09-07T10:47:23.517 | 2017-11-23T20:25:40.270 | 28666 | 2912 | [
"references",
"careers"
] |
6539 | 2 | null | 6513 | 12 | null | I've played around with electrical demand models, and I can tell you that it's a good idea to start "zoomed out". Each region has its own characteristics, but the general idea is the same.
Electric demand is a function of many variables. Starting with the slowest moving terms.
- General Economic Activity is the slo... | null | CC BY-SA 2.5 | null | 2011-01-25T19:30:59.893 | 2011-01-25T19:30:59.893 | null | null | 2775 | null |
6540 | 1 | 6555 | null | 1 | 2534 | Let say I have this kind of data:
```
1 01/1/1980
2 01/2/1999
3 03/12/2000
-1 03/6/2005
-5 07/07/2007
```
how can I calculate the Present Value (PV) to them in respect to current date, let say with 5% interest rate, in spreadsheet? `Current date` means today.
[Update] I am probably misunderstanding terms `PV` and `FV`... | How do calculate Present Value in Google Spreadsheet? | CC BY-SA 2.5 | null | 2011-01-25T19:34:09.613 | 2020-07-03T20:20:38.167 | 2020-07-03T20:20:38.167 | 35989 | 2914 | [
"econometrics"
] |
6541 | 2 | null | 6538 | 3 | null | I come from a computer science background focusing on machine learning.
However, I really started to understand (and more important to apply) statistics after taking a Pattern Recognition course using Bishop's Book
[https://www.microsoft.com/en-us/research/people/cmbishop/#!prml-book](https://www.microsoft.com/en-us/r... | null | CC BY-SA 4.0 | null | 2011-01-25T19:38:57.673 | 2018-09-07T10:47:23.517 | 2018-09-07T10:47:23.517 | 131198 | 2904 | null |
6542 | 2 | null | 6538 | 3 | null | E.T. Jaynes "Probability Theory: The Logic of Science: Principles and Elementary Applications Vol 1", Cambridge University Press, 2003 is pretty much a must-read for the Bayesian side of statistics, at about the right level. I'm looking forward to recommendations for the frequentist side of things (I have loads of mon... | null | CC BY-SA 3.0 | null | 2011-01-25T19:44:38.850 | 2013-10-09T21:32:11.783 | 2013-10-09T21:32:11.783 | 17230 | 887 | null |
6543 | 2 | null | 6538 | 12 | null | I can't speak for the more rigorous schools, but I am doing a B.S. in General Statistics (the most rigorous at my school) at University of California, Davis, and there is a fairly heavy amount of reliance on rigor and derivation. A doctorate in math will be helpful, insomuch as you will have a very strong background in... | null | CC BY-SA 2.5 | null | 2011-01-25T19:48:44.050 | 2011-01-25T22:18:51.977 | 2011-01-25T22:18:51.977 | 1118 | 1118 | null |
6544 | 1 | 6784 | null | 7 | 8013 | I have a dataset that I want to fit a simple linear model to, but I want to include the lag of the dependent variable as one of the regressors. Then I want to predict future values of this time series using forecasts I already have for the independent variables. The catch is: how do I incorporate the lag into my foreca... | Predicting from a simple linear model with lags in R | CC BY-SA 2.5 | null | 2011-01-25T19:56:10.017 | 2017-09-10T20:59:55.757 | 2011-01-26T09:11:58.750 | null | 2817 | [
"r",
"time-series",
"regression",
"predictive-models"
] |
6545 | 2 | null | 725 | 1 | null | This is a very late response, so this may no longer be of interest, but I am working on putting together an R library with various hyperspectral image processing capabilities. At the moment my focus has been on endmember detection and unmixing. If this is still something which is of interest please let me know. My hope... | null | CC BY-SA 2.5 | null | 2011-01-25T20:40:17.520 | 2011-01-25T20:40:17.520 | null | null | null | null |
6548 | 2 | null | 6499 | 10 | null | Assume that the random variables $x_k$ are i.i.d., nonnegative, integer valued, bounded by $n$, and such that $P(x_k=0)$ and $P(x_k=1)$ are both positive. For every $N\ge1$, let
$$
X_N= \min\{x_1,\ldots,x_N\}.
$$
Then, when $N\to+\infty$,
$$
E(X_N)=c^N(1+o(1)),
$$
where $c<1$ is independent of $N$ and given by
$... | null | CC BY-SA 2.5 | null | 2011-01-25T21:10:34.973 | 2011-01-27T20:44:19.810 | 2011-01-27T20:44:19.810 | 2592 | 2592 | null |
6549 | 1 | 6551 | null | 2 | 1461 | Given a univariate sample $\vec X = X_1, ..., X_n$ with standard deviation 1 and a strictly monotone transformation $t: R \to R$ with the property that the standard deviation of $t(\vec X)$ is also 1 (where $t(\vec X)$ is $t$ applied to each $X_i$). If one know fits a normal distribution to $\vec X$ and $t(\vec X)$, on... | Likelihood at MLE and transformations, the multivariate normal case | CC BY-SA 2.5 | null | 2011-01-25T22:33:24.837 | 2011-01-27T03:32:30.250 | null | null | 2916 | [
"normal-distribution",
"multivariate-analysis",
"maximum-likelihood"
] |
6550 | 1 | 6553 | null | 3 | 1908 | I have about 500 text documents stored in a directory. I want to randomly select one to read in the contents (this process will be repeated several times). The names of the files are not sequential. By this I mean they are not named something like 1.txt, 2.txt, 3.txt,... The names are basically random characters.
... | Reading random text file in R | CC BY-SA 2.5 | null | 2011-01-25T23:01:12.220 | 2011-01-26T09:11:37.347 | 2011-01-26T09:11:37.347 | null | 2310 | [
"r",
"dataset"
] |
6551 | 2 | null | 6549 | 3 | null | This is due to the invariance property of MLEs. It is an elementary exercise in calculus to show that if $E_{MLE}$ maximises the function $F(E)$ then any monotonic function of $E$, say $g=g(E)$ will also be maximised at $g_{MLE}=g(E_{MLE})$.
$F(E)=F[g^{-1}(E)]$ and therefore the maximum occurs at $F_{MAX}=F(E_{MLE})=F... | null | CC BY-SA 2.5 | null | 2011-01-25T23:39:15.153 | 2011-01-27T03:32:30.250 | 2011-01-27T03:32:30.250 | 2392 | 2392 | null |
6552 | 2 | null | 6550 | 3 | null | Do a list.files and then access each file by its index.
```
lisfil <- list.files("E:\\Data") #Replace E:\\Data with your directory name
lenlisfil <- length(lisfil)
for (i in 1:lenlisfil) {
#Do something to the current file such as:
print(lisfil[i])
}
```
| null | CC BY-SA 2.5 | null | 2011-01-25T23:39:45.370 | 2011-01-25T23:39:45.370 | null | null | 2775 | null |
6553 | 2 | null | 6550 | 6 | null | First, select one file randomly from the current directory:
```
file <- sample(list.files(), 1)
```
Then do whatever you want with it, e.g. read all lines:
```
readLines(file)
```
If you want to repeat this several times, you could do it in one step:
```
readLines(sample(list.files(), 1))
```
| null | CC BY-SA 2.5 | null | 2011-01-25T23:48:34.877 | 2011-01-25T23:48:34.877 | null | null | 2714 | null |
6554 | 1 | 6573 | null | 5 | 206 | If I have a parameter with a prior $X\sim N(\mu,\sigma)$ and three data points, $x_1,x_2,x_3$, how can I calculate the posterior in R or BUGS?
Here is an attempt at doing this in BUGS, that I have gotten stuck on:
```
data:
list(x=1.4, 2.1, 1.1, mu = 10, tau=1/10)
model {
for (i in 1:3) {
x[i] ~ dnorm(mu, tau... | Getting started on BUGS, need help implementing a simple model | CC BY-SA 2.5 | null | 2011-01-25T23:48:47.747 | 2011-01-26T15:45:58.250 | null | null | 2750 | [
"r",
"bayesian",
"bugs"
] |
6555 | 2 | null | 6540 | 2 | null | This sounds more like you want the Future Value. The Present Value is usually defined by valuing cash flows which occur in the future, not in the past. But it amounts to the same equations.
Anyways, you multiply the values in each period by $(1+r)^{t_0-t}$ and just add the results for your PV. $r$ is your interest r... | null | CC BY-SA 2.5 | null | 2011-01-26T00:05:52.667 | 2011-01-26T00:05:52.667 | null | null | 2392 | null |
6556 | 2 | null | 6524 | 1 | null | The "failsafe" way to find a sufficient statistic in just about any problem: Calculate the Bayesian posterior distribution (up to prop constant) using a uniform prior. If a sufficient statistic exists, this method will tell you what it is. So basically, strip all multiplicative factors (those factors which do not in... | null | CC BY-SA 2.5 | null | 2011-01-26T00:41:37.533 | 2011-01-26T00:46:55.203 | 2011-01-26T00:46:55.203 | 2392 | 2392 | null |
6557 | 1 | 6615 | null | 11 | 18711 | Let's say I have data:
```
x1 <- rnorm(100,2,10)
x2 <- rnorm(100,2,10)
y <- x1+x2+x1*x2+rnorm(100,1,2)
dat <- data.frame(y=y,x1=x1,x2=x2)
res <- lm(y~x1*x2,data=dat)
summary(res)
```
I want to plot the continuous by continuous interaction such that x1 is on the X axis and x2 is represented by 3 lines, one which repres... | How can one plot continuous by continuous interactions in ggplot2? | CC BY-SA 2.5 | null | 2011-01-26T01:16:56.443 | 2013-05-16T21:34:18.333 | 2011-01-26T01:48:30.457 | 196 | 196 | [
"r",
"regression",
"ggplot2",
"interaction"
] |
6558 | 2 | null | 6513 | 2 | null | @Grega:
I ran out of room in the comment area, so I started another answer.
From your comment, that's the problem. Each system/grid has its own "signature". It's a combination of system dynamics, age, weather, local economics, cultures, traditions, etc. In Japan, its worse. Some sections of the country run at 50Hz... | null | CC BY-SA 2.5 | null | 2011-01-26T01:18:49.687 | 2011-01-26T04:19:31.357 | 2011-01-26T04:19:31.357 | 2775 | 2775 | null |
6559 | 2 | null | 6544 | 0 | null | Ok, I answered my own problem, but my solution could use more testing and probably isn't perfect. Suggestions would be appreciated!
First of all I used a modified version of the parseCall function available [here](http://rguha.net/code/R/parseCall.R):
```
parseCall <- function(obj) {
if (class(obj) != 'call') {
... | null | CC BY-SA 2.5 | null | 2011-01-26T02:15:57.690 | 2011-01-26T02:15:57.690 | null | null | 2817 | null |
6560 | 1 | 6564 | null | 8 | 203 | I'm looking for some help devising a hypothesis test for the following situation.
- I have a radioactive source that spits out a particle every so often.
- Also, I have two particle detectors: a red particle detector, and a green particle detector. Whenever the red particle detector detects a particle, it flashes a ... | Test for independence, when I'm missing one bin of a 2x2 contingency | CC BY-SA 2.5 | null | 2011-01-26T02:28:03.963 | 2011-01-27T23:42:20.253 | null | null | 2921 | [
"hypothesis-testing"
] |
6561 | 2 | null | 6557 | 5 | null | Computing the estimates for y with Z-score of 0 (y0 column), -1 (y1m column) and 1 (y1p column):
```
dat$y0 <- res$coefficients[[1]] + res$coefficients[[2]]*dat$x1 + res$coefficients[[3]]*0 + res$coefficients[[4]]*dat$x1*0
dat$y1m <- res$coefficients[[1]] + res$coefficients[[2]]*dat$x1 + res$coefficients[[3]]*-1 + res... | null | CC BY-SA 2.5 | null | 2011-01-26T02:28:45.770 | 2011-01-26T02:28:45.770 | null | null | 2714 | null |
6562 | 1 | 6566 | null | 4 | 1334 | I have read an [article](http://nlp.stanford.edu/~manning/courses/ling289/logistic.pdf) from Christopher Manning, and saw an interesting code for collapsing categorical variable in an logistic regression model:
```
glm(ced.del ~ cat + follows + I(class == 1), family=binomial("logit"))
```
Does the `I(class == 1)` mean... | Collapsing categorical data easily for regression in R | CC BY-SA 4.0 | null | 2011-01-26T02:41:40.690 | 2019-11-19T00:12:21.507 | 2019-11-19T00:12:21.507 | 11887 | 588 | [
"r",
"logistic",
"categorical-encoding"
] |
6563 | 1 | null | null | 18 | 3014 | There is one variable in my data have 80% of missing data. The data is missing because of non-existence (i.e. how much bank loan the company owes). I came across an article saying that dummy variable adjustment method is the solution for this problem. Meaning that I need to transform this continuous variable to categor... | 80% of missing data in a single variable | CC BY-SA 4.0 | null | 2011-01-26T02:53:22.350 | 2020-03-03T14:41:10.503 | 2020-03-03T14:41:10.503 | 11887 | 2793 | [
"missing-data"
] |
6564 | 2 | null | 6560 | 8 | null | If the missing count were close to 22*12/17, the table would appear independent. This is consistent with your observations. If the missing count is far from this value, the table would exhibit strong lack of dependence. This, too, is consistent with your observations. Evidently your data cannot discriminate the two... | null | CC BY-SA 2.5 | null | 2011-01-26T03:22:22.153 | 2011-01-26T03:22:22.153 | null | null | 919 | null |
6565 | 2 | null | 6563 | 27 | null | Are the data "missing" in the sense of being unknown or does it just mean there is no loan (so the loan amount is zero)? It sounds like the latter, in which case you need an additional binary dummy to indicate whether there is a loan. No transformation of the loan amount is needed (apart, perhaps, from a continuous r... | null | CC BY-SA 2.5 | null | 2011-01-26T03:27:01.367 | 2011-01-26T03:34:37.983 | 2011-01-26T03:34:37.983 | 919 | 919 | null |
6566 | 2 | null | 6562 | 4 | null | This shows what the first is doing:
```
> class <- sample(1:5, 10, replace = TRUE)
> class == 1
[1] TRUE FALSE FALSE FALSE TRUE TRUE TRUE FALSE TRUE TRUE
> as.numeric(class == 1)
[1] 1 0 0 0 1 1 1 0 1 1
> ## or better,
> factor(as.numeric(class == 1))
[1] 1 0 0 0 1 1 1 0 1 1
Levels: 0 1
```
`class == 1` is cr... | null | CC BY-SA 2.5 | null | 2011-01-26T09:07:10.353 | 2011-01-26T09:07:10.353 | null | null | 1390 | null |
6567 | 2 | null | 4466 | 4 | null | I would recomend two things in addition to the excellent answers already present;
- At Key points in your code, dump out the current data as a flat file, suitably named and described in comments, thus highlighting if one package has produced differing results where the differences have been introduced. These data fil... | null | CC BY-SA 2.5 | null | 2011-01-26T10:02:07.550 | 2011-01-26T10:02:07.550 | null | null | 114 | null |
6568 | 2 | null | 6176 | 16 | null | For a really short introduction (seven page pdf), there's also this, intended to allow you to follow papers that use a bit of measure theory :
[A Measure Theory Tutorial (Measure Theory for Dummies)](http://www.ee.washington.edu/research/guptalab/publications/MeasureTheoryTutorial.pdf). Maya R. Gupta.
Dept of Electrica... | null | CC BY-SA 3.0 | null | 2011-01-26T11:09:56.750 | 2017-02-27T10:55:00.140 | 2017-02-27T10:55:00.140 | 10278 | 449 | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.