Use this tag for any *on-topic* question that (a) involves `R` either as a critical part of the question or expected answer, & (b) is not *just* about how to use `R`.

learn more… | top users | synonyms

0
votes
1answer
125 views

Obtain p-values from t-values

I used Tobit regression and wanted to test if the coefficients are significant. The problem is that when I run the R code I get t-values instead of z-values. I found code on how to calculate p-values ...
1
vote
1answer
7k views

How to estimate GARCH in R? (Exogenous variables in mean equation)

What I'm trying to do is estimate the following GARCH(1,1) model in R with the garchFit function from the fGarch package: ...
3
votes
1answer
1k views

When using glmnet how to report p-value significance to claim significance of predictors?

I have a large set of predictors (more than 43,000) for predicting a dependent variable which can take 2 values (0 or 1). The number of observations is more than 45,000. Most of the predictors are ...
3
votes
1answer
827 views

Intuition behind tensor product interactions in GAMs (MGCV package in R)

Generalized additive models are those where $$ y = \alpha + f_1(x_1) + f_2(x_2) + e_i$$ for example. the functions are smooth, and to be estimated. Usually by penalized splines. MGCV is a package ...
1
vote
1answer
2k views

Problems optimizing a likelihood function in R

I'm trying to maximize the log-likelihood $y_1 \log(p_1) + (1-y_1)\log(p_1) + y_2\log(p_2) + (1-y_2)\log(p_2)$. I have data on success of an experiment. Y identifies if person died or not, and X ...
0
votes
1answer
88 views

How do I determine whether traits in a subgroup of a big group are significantly different than the traits in the whole group in R

I have a big group of 1052 people. Out of 18 people with trait A 11 people also have trait B. Out of the whole group of 1052 people 569 have trait B. How do I determine in R whether the trait B is ...
1
vote
1answer
129 views

R and Predictions

If I use linear model, generalized linear model, partial least squares etc packages in R, and train it where, given key response variable RSP, the formula argument ...
4
votes
1answer
3k views

How to validate & diagnose a gamma GLM in R?

I am fitting a generalized linear model in R with the log link and I need to validate and diagnose my model. I have never worked with the GLM in the past. Is there an article or any references I ...
1
vote
0answers
683 views

Effect sizes from LMM

My question is, how to get effect sizes for a linear mixed model? I am using the following model in SPSS: ...
2
votes
0answers
311 views

Simulated Microarray data

I would like to generate synthetic microarray data sets for simulation purposes. The web and literature search so far returned the following: Microarray Simulator - It provides Matlab skripts to ...
1
vote
1answer
1k views

how to interpret reading decision tree result from ctree() in r?

After running ctree(model) My result look like this below : ...
3
votes
2answers
323 views

p-value for correlation/co-occurrence in sets of intervals

I'd like to have a probability measure for the co-occurrence of intervals in two datasets of intervals. ...
3
votes
1answer
286 views

Different confidence interval results in R, why?

Using the following population: sample <- c(41.5, 56.7, 54.2, 98.9, 56.7, 43.9, 35.8, 28.8) I get a different result for the upper and lower confidence ...
4
votes
1answer
3k views

Why does a mixed design using R's aov() need the between subject factors specified more than once?

An R cookbook http://wiki.stdout.org/rcookbook/Statistical%20analysis/ANOVA/ has an example of using aov() for mixed design ANOVAs. I'll copy it here: ...
0
votes
0answers
389 views

multilevel-model, lmer()-spelling and interpretation?

I m working on a piecewise linear growth model and I need help to understand how to write my lmer() code and how to interpret the ...
8
votes
2answers
6k views

Zero-inflated count models in R: what is the real advantage?

For analysing zero-inflated bird counts I'd like to apply zero-inflated count models using the R package pscl. However, having a look at the example provided in the documentation for one of the main ...
0
votes
0answers
145 views

Panel data with two time factors

I've got some data that come from a economic experiment. I'm trying to fit a model using plm() function (plm package). I'm following a very good tutorial (Panel data econometrics in R: The plm ...
3
votes
0answers
327 views

Resampling or Basic Simulation and confidence intervals

I have a population of sales that might be won or lost. I know the rate that they are won from historical data. This case 30% of them historically win. To figure out how much money I will be making ...
5
votes
1answer
280 views

Regarding the sampling procedure in Adaboost algorithm

The AdaBoost algorithm states that it is to train a classifier based on the training data according to a weight vector. Assume the size of training data is N, the weight vector is of dimension N as ...
1
vote
2answers
149 views

How to generate normal variates subject to mixed constraints?

I want to randomly generate 1000 normal variates (using rnorm, e.g.) that have mean 100. 25% of the 1000 numbers should be over 110. How can I do this in ...
4
votes
1answer
123 views

Chi Square Test for QC Samples

An analytical procedure is run for 112 consecutive days. Each day, the analyses are run in four batches in order -- Batch-1, Batch-2, etc. In each batch is a QC sample, labeled QC1, QC2, etc. The ...
7
votes
6answers
980 views

R2jags does not remove the burn in part sometimes?

I found out that the function jags() in the R2jags package sometimes does not remove the burn in part even with the option ...
7
votes
2answers
10k views

Graphs in regression discontinuity design in “Stata” or “R”

Lee and Lemieux (p. 31, 2009) suggest the researcher to present the graphs while doing Regression discontinuity design analysis (RDD). They suggest the following procedure: "...for some bandwidth ...
12
votes
3answers
28k views

Manually Calculating P value from t-value in t-test

I have a sample dataset with 31 values. I ran a two-tailed t-test using R to test if the true mean is equal to 10: t.test(x=data, mu=10, conf.level=0.95) Output: ...
5
votes
1answer
221 views

Spatial interpolation models: deterministic vs statistical

I am applying diferent methods to interpolate continuous spatial surfaces (kriging, splines, glm,etc). Most of the studies that have enough detail for me to follow usually focus on one specific ...
1
vote
1answer
628 views

R working the tsDyn and Time series

Hello I am trying to work with the tsDyn packages to fit time series. Save me a lot of time if I could get this package to work correctly. I am working with data that looks like this: ...
0
votes
1answer
491 views

Error while calculating metrics like AUC, ACC in R

I am trying to make predictions on my validation data using a decision tree model created with training data set. I am able to do that with success but, I am not able to calculate various metrics like ...
0
votes
0answers
584 views

fisher's test vs pairwise fisher's test

I have a fold enrichment table for different days as given below. I need to find the significance of every fold enrichment. ...
1
vote
1answer
613 views

Forecast with STL and regressors (using R package forecast)

I would like to use the stlf forecast function from the R package forecast (http://cran.r-project.org/web/packages/forecast/index.html) and include regressors in the model. Question 1: This can only ...
3
votes
1answer
81 views

Bootstrap the Complexity Index in (Ex)TraMineR?

I'm computing the Complexity Index using TraMineR. Does it make sense to use the bootstrap procedure in order to obtain the confidence intervals for the Complexity Indexes? In this case, is there a ...
2
votes
1answer
3k views

Interpreting multinomial logistic regression output in R

I am trying to perform multinomial logistic regression on my data which is as below(just the header). "category" is my target variable and all other variables are independent variables. category has ...
4
votes
2answers
15k views

What are the values p, d, q, in ARIMA?

In the arima function in R, what does order(1, 0, 12) mean? What are the values that can be assigned to ...
1
vote
2answers
7k views

How do you use simple exponential smoothing in R?

I'm beginner in R, Could you please explain how to use ses in forecast package of R forecast? I'd like to choose the number of initial periods and smoothing constant. ...
0
votes
1answer
96 views

Generate correlated IMA(1,1) using R

I'd like to use R to generate two correlated series that follow IMA(1,1) process. rho is a correlation between the error terms, but when I changed the rho the plot does not change. Is it wrong if I ...
1
vote
1answer
80 views

“Continuing” an ARMA process

I have a time series and fitted an AR(I)MA object (I really just want an ARMA process so the order is (p,0,q)) in R. Now I'd like to "continue" that process (I guess what I mean is perform ...
2
votes
1answer
1k views

R neural net training and prediction

I am trying to form a model on a set of data that I gathered from MT4. The OHLC and some MA slopes. I am trying to get the best guess for price change in the future. I am using ...
2
votes
1answer
824 views

Does SPSS rescale dendrograms?

A colleague and I have been clustering some data in SPSS (v19) and R (2.15), respectively. Using the same distance metric and agglomeration method, we get identical merge orders/agglomeration ...
5
votes
1answer
423 views

Comparing minitab output to R

I am trying to recreate analysis of diamond data in R and compare it to minitab output cited in http://www.amstat.org/publications/jse/v9n2/datasets.chu.html I'm almost certain its the same data set ...
1
vote
1answer
48 views

Two-Component distribution modelling

I am trying to plot a two-component mixture distribution $F_X(x):.7N(0,1)+.3N(3,1)$ with density $$f_X(x) = {0.7 \over {\sqrt{2\pi}}} e^{−x^2/2} + {0.3 \over {\sqrt{2\pi}}}e^{−(x−3)^2/2} $$. I have ...
0
votes
0answers
147 views

How to get a nice regress model?

I am doing a regression analysis which troubled me. My independent variable are 4 interplanetary condition components, and the dependent variable is the latitude of auroral oval boundary. So far, ...
0
votes
0answers
89 views

finding x intercept from a set of values

I have run an ACF on a function in R and it returns: Autocorrelations of series ‘sine.curve’, by lag ...
2
votes
1answer
2k views

Deletion residuals

Please can you help me to solve this problem. It should be calculated by vectorization. The question is: The i-th deletion residual $e_{(-i)}$ is defined as $e_{(-i)} = y_i - X^\top B_{(-i)}$ ...
2
votes
2answers
303 views
1
vote
1answer
311 views

statistical analysis between two time series

I have two time series, which by looking at they appear to be correlated i.e. when one is high the other is high, and when one is low the other is low. Besides looking at the figure and saying these ...
0
votes
2answers
801 views

R, getting data.frame factor name by index [closed]

I have a data frame, and I'm trying to get name of its factor (as string) by index. For example, ...
1
vote
0answers
162 views

Which 'delta' to use from those returned by 'orddom' package in R with argument 'paired = TRUE'?

I have used the orddom package in R with the argument paired = TRUE to calculate the Cliff’s delta for paired groups, and a ...
46
votes
3answers
56k views

How are the standard errors of coefficients calculated in a regression?

For my own understanding, I am interested in manually replicating the calculation of the standard errors of estimated coefficients as, for example, come with the output of the ...
3
votes
2answers
991 views

Replicating a plot from the ROCR Website

I'm trying to reproduce this plot from the ROCR website: I can get something similar as follows: ...
1
vote
2answers
1k views

Adjusted mortality rates

I have some data similar to this ...
3
votes
1answer
113 views

Multilevel or fixed effects to estimate panel of port costs?

I have a panel dataset on seaborne shipment prices for a sample of trading routes. The data is a fixed annual price, based on a) port costs and b) fuel (a function of distance and fuel price). The ...