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

-4
votes
0answers
24 views

Coding a formula in R?

I want to code the following formula in R. I will be more happy if any one provides me some help. The formula is Eti = Eo + (Em-Eo/tm-to)*(ti-to) I will be gladfull for thsi help
0
votes
0answers
3 views

R Packages for rank-preserving structural failure time model (RPSTM)

I have a randomized clinical trial data that has high percentage(30-40% in both arms) switching over to a different treatment regimen. By browsing through some literature, I am inclined to perform ...
0
votes
0answers
2 views

Help with multiple landmark and Non-Metric Data INPUT [on hold]

Thank you all in advance for being so kind as to put up with my extremely beginner level R-Studio (and statistics programming in general) skills. I am struggling with the most basic of tasks-combining ...
0
votes
0answers
7 views

How to get standard errors for parameter estimates from full model-averaged coefficients (with shrinkage)

I'm using MuMIn to calculate parameter estimates in a model averaging procedure. Right now I want to compare parameter estimates from conditional vs shrinkage. I want to compare both parameter ...
2
votes
0answers
20 views

When do coefficients estimated by logistic and logit-linear regression differ?

When modelling continuous proportions (e.g. proportional vegetation cover at survey quadrats, or proportion of time engaged in an activity), logistic regression is considered inappropriate (e.g. ...
2
votes
1answer
14 views

Interpreting results of prop.test()

Suppose that I have two approaches to a particular problem. Approach A is observed to succeed 685 times out of 1347 attempts. Approach B is observed to succeed 2100 times out of 3748 attempts. I ...
0
votes
1answer
39 views

Cross validation for logistic regression in R

I am doing a K-fold cross validation for a logistic regression. I first used the PCA to reduce the dimensionality. Then I used those principal components to build the regression model. My problem is ...
0
votes
0answers
19 views

Model Stacking algorithm

I'm trying the stacking method to see if it improves my results, but before using some R package, i decided to code it by myself. Here's a pseudocode of what i'm doing: ...
1
vote
0answers
16 views

Approach and example of graph clustering in “R”

I am looking to group/merge nodes in a graph using graph clustering in 'r'. Here is a stunningly toy variation of my problem. There are two "clusters" There is a "bridge" connecting the clusters ...
0
votes
0answers
7 views

Subset items from a group while controlling for variables between groups

Can anyone offer solutions to the following problem?: I'm trying to extract a subset of items from multiple groups (grouped by 2 separate factors) so that the final groups are: 1) of equal size, and ...
0
votes
0answers
17 views

best way of univariate prediction for sparse data

I have a client who has sparse hourly data (by sparse I mean there are too many hours with 0 calls). I used TBATS in R to forecast hourly data for them. Regardless of the point forecast, the actual ...
0
votes
0answers
14 views

Estimate the conditional distribution of an latent variable?

What techniques might best illuminate the underlying conditional distribution of a latent variable and what information or assumptions would improve that illumination? For example, if we have data ...
0
votes
1answer
16 views

Calculating Standard Deviation when given sample size, mean difference & p value

I am trying to pool data in my meta-analysis and i need MEAN & SD. However the study has reported sample size (27), before (11.8) & after mean (11.9), and p value (0.540). I need the SD. ...
0
votes
0answers
13 views

Choropleth / thematic map in R with ggplot2 not filling polygons [migrated]

I am doing the following: I read a shapefile containing boundaries within a city (Leeds for example), then I read another data set (csv.) containing the number of females in each area for which I ...
0
votes
1answer
34 views

Relation between $R^2$ and the covariate correlation matrix

I'm quite new to Statistics and I'm facing a problem. Is there any relation between $R^2$ and the correlation matrix of the covariates? A short example is (case with 2 covariates) : A7 ~ A1 + A2 ...
-1
votes
0answers
11 views

Can I use gzlm with Poisson family if counts data are treated as factors?

My data called (my data) looks like below and I have 5 DVS(dv1,dv2,dv3,dv4,dv5) note all under one column and three IVS(IV1,IV2,IV3) as a data frame. I keep getting the error below. I am trying to fit ...
1
vote
1answer
17 views

Logistic regression: Overall significance of categorical predictor in SPSS

In SPSS, when performing binary logistic regression using multiple categorical predictors, a significance level is detailed for the variable overall in addition to each category. This strikes me as ...
0
votes
0answers
5 views

How to test/validate unlabeled data in association rules in R?

I produced association rules by using the arules package (apriori). I'm left with +/- 250 rules. I would like to test/validate the rules that I have, like answering the question: How do I know that ...
0
votes
0answers
19 views

How do test that two continuous variables are independent using rank statistics in R? [on hold]

This question a particular case of this question. Suppose we have a sample $(X_i,Y_i),i=1,\ldots,n$ from the joint distribution of $X$ and $Y$. Are there any other function (or package) apart from ...
0
votes
0answers
23 views

Regression of Higher order [migrated]

I want to fit a model $Y = X_1^2 + X_2^2 + X_1 + X_2 + X_1\cdot X_2$ How to build this in R glm(Y ~ poly(X1,2) * poly(X2,2) how to generalise it to higher order ...
2
votes
1answer
28 views

One sample test of uniformity in R

I have a dataset of two columns: one with IDs and one with a column of single digits (0-9) (see below). I would like a statistical significance test for whether the data is uniform. Ideally, I would ...
0
votes
0answers
6 views

Adjusting for outlier in Fractional logit in R when dv is very small proportion

I used the code from this site: http://stackoverflow.com/questions/19893133/fractional-logit-model-r to estimate a fractional logit model. There are 90 observations in my dataMy dependent variable is ...
0
votes
0answers
7 views

Using different sets of binary indicators based on another indicator - R, linear regression

I'm trying to come up with a prediction model for an output based on the hour of the day. I already have a simple model that predicts the output based on 23 factors that represent each hour of the day ...
0
votes
0answers
6 views

Zero-inflated mixed models with two-stage fitting

Zero-inflated models have a count component (Poisson/Neg. Binomial) and a zero component (logistic regression part). glmmADMB supports the zero-inflation feature but only through estimating a ...
2
votes
0answers
28 views

Does my yeast population split?

Description of the data Imagine a population of yeasts that move along 1 dimension through time. They may move more or less randomly and eventually at some point the population will more or less ...
0
votes
1answer
19 views

Critical value for Wilcoxon one-sample signed-rank test in R

I am trying to find the critical value for the Wilcoxon one-sample signed-rank test. Currently, I can find the value using tables. I looked at qwilcox() in R, but ...
0
votes
0answers
11 views

Is this R code of Rao score test for the Bernoulli data model correct? [migrated]

I am a complete statistical noob and new to R, hence the question. I've tried to find an implementation of the Rao score for the particular case when one's data is ...
0
votes
0answers
12 views

Penalized ML estimation of non-linear probit

I have a model of the form $P(y_i=1) = \Phi(\frac{w_1^{\beta'x_i}-w_2^{\beta'x_i}}{\sigma' x_i})$ where $y_i$ is a binary response, $\Phi$ is the normal CDF, $w_1$ and $w_2$ are non-negative ...
0
votes
0answers
11 views

Degrees of freedom clarification [duplicate]

I'm new to statistics, and so far I'm not grasping the significance of the concept of "degrees of freedom". So far, I've only had tangential exposure to it by way of calculating Student's t. When we ...
0
votes
0answers
10 views

Bias linear regression R [on hold]

Consider a linear statistical model: y = a + bx1 + cx2 + e The parameters are a, b, c and sd(e), The analysis is focused on valid estimation of b. If cov(x,z) =/= θ, and z is excluded from the model ...
0
votes
1answer
13 views

Systematic Sampling with unequal probabilities

I found the library Sampling in R to conduct a systematic random sampling with unequal probabilities. I got my sample but I really don't know how that sample is selected. Is there anyone that can ...
0
votes
0answers
10 views

Simulation Record Values from a Continuous Distribution [on hold]

The records in a series of observations are those values which are more or less than their previous values.how can we generating this values in R?
2
votes
1answer
32 views

How to interpret VIF?

I am using the vif function in the R package car to test for multicollinearity. I am a little confused at the output given. For example, I have 5 variables (x1, x2, ...
0
votes
0answers
17 views

Kruskal-Wallis and post-hoc analysis in R

Although I know there are several post in this forum that are about this topic, none of them was useful in my case. I have the next data: ...
0
votes
1answer
29 views

Normalize time series with different lengths with linear interpolation in R

I have a large set of time series (100k, each 3 observations), their lengths varies about 10% on average. Each of them cover the time interval of the same lengths but varies due to rate of sampling, ...
1
vote
2answers
51 views

Random intercept turns insignificant - Interpretation

I am running a intercept model with intercepts varying across people in R. My independent variables are all numeric variables. My question is a general one: I saw already that it can happen that my ...
0
votes
0answers
13 views

unit root test for seasonal data [migrated]

How to perform unit root test for seasonal data series by using Eviews and R software? i've tried R code provided by Rob J Hyndman in OTexts, but still can't use.
2
votes
0answers
13 views

Prediction intervals for mixture models for time series forecasting - is it really an average of the prediction intervals of the averaged models?

I'm trying to find out how to do forecasting with a mixture model (averaging the forecasts of an ets, an arima and an ...
0
votes
0answers
25 views

Multiple linear regression [on hold]

I have two data frames of Precipitation and Evapotranspiration with equal rows and column and I want to run the following multiple regression equation so that I can estimate a1 a2 b1 and b2 in the ...
0
votes
0answers
27 views

Diebold Mariano test for multiple forecasts in R

I am trying to do Diebold Mariano test for multiple forecasts. How do you implement this in R? Thanks a lot.
1
vote
0answers
9 views

How to do test set evaluation using a regression model in Caret?

I'm used to using Caret to do classification but now I need to use it for regression. I have successfully trained a model on my training set but I'm not sure what ...
0
votes
1answer
31 views

Material difference between Mixed Effects Model and normal Linear Model

I have a question about normal linear models vs mixed models. Say I'm predicting prices for certain products, and I know two things: store and brand: In a linear model (lm), this would be: ...
0
votes
0answers
8 views

neural networks in R with multiple entries for one id [migrated]

I have a dataset with multiple rows for one id. The multiple row signifies the reading in each month. and there are multiple id's in the same fashion. eg id,t1,x1,x2,x3,y A,1,2,3,4,5 A,2,4,2,6,5 ...
0
votes
0answers
9 views

Forecasting hierarchical time series with different model for each bottom time series?

I have univariate time series data for each country of the world. I am interested in forecasting at both the global and individual-country levels. Although the value being measured is the same, the ...
0
votes
0answers
13 views

Joint Probability of multiple correlated variables

I have annual extreme values (logIII distribution) from multiple (3 in this case, but looking for a solution that is more universal) sites, and I am trying to calculate the probability that all exceed ...
0
votes
0answers
20 views

How can I use the output of KODAMA to predict unknown data points?

I can use KODAMA to create a model that classifies input data into two groups by setting the W vector to indicate the group and fix to a vector of all ...
0
votes
0answers
10 views

Add existing scripts to an Rstudio project [migrated]

I'm working in Rstudio and have multiple scripts open that have different working directories; however, each working directory exists within a larger folder on my computer (see below). Is it possible ...
0
votes
2answers
34 views

Predictive Accuracy formula in Excel or R [duplicate]

I have posted this question, not sure how to move that question to this stats.stackexchange.com. ...
1
vote
0answers
18 views

How do I obtain the slope and intercept for each regression with a 2-level factor?

Suppose I have a data frame that include a factor with two levels. The response is proportional to the predictor, but the slope depends on the factor: ...
0
votes
0answers
45 views

Autoregressive model in R

Citation: As the data represent repeated measurements from individual plots, within-plot correlation may result in inefficient estimates and underestimation of standard error. Therefore the ...