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 program in `R`.

learn more… | top users | synonyms

0
votes
1answer
8 views

AFT model with time varying independent variables

I am a newbie in survival analysis and I would like to pose some simple questions, after reading numerous posts regarding how to perform survival analysis in R. So, what I would like to know is: Can ...
0
votes
0answers
4 views

what is the best forecast interval for tbats?

I used tbats to fit a model to a set of weekly data (but only for weekdays) so I have seasonality of 5 for daily and 261 of annual. I wonder if tbats works better by updating the model using observed ...
0
votes
1answer
27 views

How can I run an analysis of variance with one independent variable and multiple dependent variables?

From my limited statistical knowledge, I could use MANOVA if I had multiple independent variables (x1, x2...xn). What can I do (specifically in R) with one "x" variable and multiple "y" groups? I'm ...
1
vote
0answers
4 views

How to model non-linear, linear and crossed random effects in one model

I have a model with fixed and crossed random effects like this: glmer(response~1+var1+var2+var3+var3^2+(1|var4)+(1|var5)+(1|var6), family="poisson") Now, I decided that variable3 is best modelled ...
1
vote
1answer
18 views

Seasonal adjustment for a series that has already been adjusted

A dataset I am working with (from the OECD), for harmonised unemployment seems to be seasonally adjusted: The unemployment rates shown here are calculated as the number of unemployed persons as a ...
0
votes
0answers
10 views

Does the calculation of error bars in lme4 require the Cosineau (2005) correction?

In Cosineau (2005) a method for calculating within-subject design error bars which removes the between subjects variance before calculating confidence intervals, error bars and so on is suggested. I ...
0
votes
0answers
13 views

Multivariate Multiple Logistic Regression in R

I have several dependent and independent variables. All my dependent variables are binary, therefore, I want to perform a multivariate multiple logistic regression, is that possible to do in R?
0
votes
0answers
4 views

Multiple combinations (ex drug-ADR) with the same unique case ID.

I am quite new to R statistics, and I one you can help me. I have tried finding the answer to my question by searching the forum and so on, and I apologize in advance if my question is trivial or ...
1
vote
0answers
38 views

Logistic regression gives very different result to Fisher's exact test - why?

I have a confusing situation where I have strongly conflicting results from two ways of analyzing my simple data. I measure two binary variables from each participant, AestheticOnly and ChoiceVA. I ...
-1
votes
0answers
15 views

How to store multiple predicted values in R [on hold]

I have the below code which is throwing error .I need to store multiple prediction arrays so i'd finally have pred1 ,pred2,...pred99 ...
0
votes
0answers
17 views

Fuzzy regression (using linear programming)

I want to replicate a fuzzy regression using a linear programming problem approach. I have the following information: " A fuzzy regression analysis with only one independent variable X results in ...
3
votes
3answers
569 views

Why there is no significant difference between a number list and its 100 times list

I am finding that there is no significant difference between a number list and another list which has 100*same numbers. The P value is 0.4487. The means are obviously very different (100 times). Why ...
1
vote
0answers
10 views

Using interaction terms in an MCMCglmm

I am using MCMCglmm models in R, with hierarchically nested data. The basic structure of the data is as follows - each dyad is a unique combination of focal/other: ...
0
votes
0answers
5 views

MCMCglmm interpretation of effective sample size

I'm running a selection of MCMCglmm models in R, and have a basic question about the outputs. Based on what I've been reading, one indication that the model is mixing well is a large effective ...
0
votes
0answers
10 views

How can I make decisions from the output of predict.coxph()?

I'm studying Survival Analysis for the purposes of customer churn modeling. I've managed to put together a model, but I'm confused about what to do with the output. As I understand it, the output is a ...
0
votes
1answer
45 views

model selection through shrinkage (Lasso) using glmnet

I would like to use model selection through shrinkage (Lasso) using glmnet. After trying the example of the glmnet manual and tried the procedure with my data. ...
0
votes
0answers
14 views

Impute missing values using aregImpute

I have a data frame with 61 columns. Some data is missing. I read in Steyerberg's book about aregImpute in Hmisc. I used it with ...
2
votes
0answers
29 views

How to compare variables' coefficients obtained from lasso?

My situation: small sample size: 116 binary outcome variable long list of explanatory variables: 50 explanatory variables did not come from the top of my head; their choice was based on the ...
2
votes
1answer
50 views

How to ensure that the most appropriate value for lambda is chosen in lasso?

My situation: small sample size: 116 binary outcome variable long list of explanatory variables: 50 explanatory variables did not come from the top of my head; their choice was based on the ...
1
vote
1answer
56 views

How to assess the incremental additive information of a new predictor in a Cox model using R?

I want to check whether the addition of the new predictor x3 improves the predictive information of a Cox model significantly or not. So far I have: ...
0
votes
1answer
15 views

Comparing coefficients of linear “ Stochastic Frontier Production and Cost Functions” in R

I am using the function frontier::sfa() in R to obtain the Stochastic Frontier Production and Cost Function as followed: ...
0
votes
0answers
30 views

Linear regression vs additive modelling, any meaning when linear modelling has higher accuracy?

I have a simple question. Is there any important meaning when non-linear modelling (general additive modelling such as gamm in R) has lower accuracy than linear modelling? some useful plots are ...
-4
votes
0answers
19 views
0
votes
0answers
15 views

Suppress automatic outputs in Rstudio [on hold]

When i run auto.arima it shows the whole process in the console, which when trying to create a report ends up showing this: http://i.stack.imgur.com/GP58B.png Is there a way to stop this appearing? ...
0
votes
0answers
10 views

Bivariate Zero-inflated negative binomial distribution regression?

I have two correlated random variables, for one experiment, the readout look like: For random variable A: ...
1
vote
0answers
18 views

Please review my app logic - R Newb [migrated]

I want to compare values between 2 consecutive rows of the same column. Example: "Is col1.row1 less than col1.row2" "Is col1.row2 less than col1.row3" "Is col1.row3 less than col1.row4" Is my plan ...
0
votes
0answers
8 views

R Clustering Evaluation (Adaptive Kmeans)

i know there are several threads about this topic, but most i read, most i get confused. I'm doing a project that consists in clustering some data (news articles). I used adaptive Kmeans ...
0
votes
0answers
23 views

regression analysis to find relation among grades of student

I have a data set containing 10 subjects and students grade in those subjects(A+,A,B+,B,C+,C,D+,D) i want to find out out if the grades of one subject is affecting the grades for other subjects. ...
1
vote
1answer
30 views

Is it possible to get a covariance matrix of fitted values for a GLM model in R?

I would like to get a covariance matrix of fitted probabilities for a logistic regression model in R. I would like to do this because I want to find the variance of the difference between the two ...
1
vote
0answers
10 views

Multiple objective allocation function

I have an allocation problem where, for a given good, I have buyer $i$ willing to buy up to quantity $b_{s,i}$ and seller $j$ willing to sell up to quantity $s_{s,i}$. There are $N$ buyers and $M$ ...
0
votes
3answers
59 views

smart sampling techniques in r

I have a large data set of about 1.8 million rows with 80 variables. I would like to find a good technique (code or package) in R that can reduce the amount of training data without damaging the ...
0
votes
0answers
23 views

Bootstrap confidence interval for case control data in R

I have a matched case-control data material and am estimating a risk-measure parameter with a certain estimator. I want to use bootstrap methodology to estimate confidence intervals for the parameter ...
0
votes
0answers
26 views

How to conveniently add a large set of regressors in R? [migrated]

I have to add approximately 30 dummy variables to a regression. If my variables would be named dummy1 - dummy30, I would denote ...
0
votes
0answers
60 views

Has anyone tried to parallelize multiple imputation in 'mice' package?

I'm aware of the fact that Amelia R package provides some support for parallel multiple imputation (MI). However, preliminary ...
0
votes
1answer
24 views

different HRs and corresponding CIs with cph and coxph

I tried a model using cph and coxph: ...
0
votes
1answer
30 views

Computing conditional variance

Is there a package in R that does that? How could I compute the conditional variance $\mathrm{var}(y|x)$ of a sample? I also don't know what to do in case where there are not enough $y$ for each ...
1
vote
1answer
47 views

Is R software being used for commercial purpose as it is open source

I would like to learn R programming as I am interested in learning new programming language. Is R software being used for commercial purpose especially in financial industry.
0
votes
0answers
19 views

In R, when plotting using ggvis, how to specify plot range? [on hold]

When plotting using ggvis(x = ~c1, y = ~c2) the range of both axes are automatically determined. But I would like to show a larger range. How to set it? I read ...
0
votes
0answers
5 views

R- yaimpute - standarize value before KNN for imputation

I need to impute data before running a logistic regression. I'm trying the package yaimpute but I realized that it doesn't standarize before imputing. I created a sample matrix to view so: ...
0
votes
1answer
41 views

How am I using KS test incorrectly in R?

Here are the codes I input into R: ...
0
votes
0answers
7 views

Rcmdr package not installed [migrated]

When I tried to installed Rcmdr package with this command: install.packages("Rcmdr",dependencies=TRUE) I got following error message: ...
4
votes
2answers
364 views

For plotting with R, should I learn ggplot2 or ggvis?

For plotting with R, should I learn ggplot2 or ggvis? I don't necessarily want to learn both if one of them is superior in any regard. Why R community keeps creating new packages with overlapping ...
1
vote
1answer
68 views

What methods are used in order to prove the independence of two variables in statistics?

I have four variables (attributes) describing student. They are categorical data. I need to prove that these variables are independent. The easiest way (even not sufficient) is to see the ...
2
votes
2answers
64 views

Replicating Stata's “robust” option in R

I have been trying to replicate the results of the Stata option robust in R. I have used the rlm command form the MASS package ...
0
votes
0answers
11 views

Hmisc::describe not working with dataframe [migrated]

I need a "describe" function that reports values with more than two decimal places and so I thought I would use the Hmisc describe function but even when using the sample code from ...
0
votes
0answers
5 views

Spatially explicit capture–recapture with R: density estimation of transect detectors in SECR

Dear stakexchange community I am new here and I hope to get an answer about density estimation of transect detectors in SECR. To my data: I collected samples of individuals at eight transects. Data ...
0
votes
0answers
31 views

R Bayesian prediction of a Gaussian process

I have a Gaussian model with mean zero, variance is arbitrary constant, and correlation function $e^{-\theta(x-x')^2}$ where $\theta$ is again an arbitrary constant. I've plotted some realizations of ...
11
votes
1answer
131 views
+150

Invalid inference when observations are not independent

I learned in elementary statistics that, with a general linear model, for inferences to be valid, observations must be independent. When clustering occurs, independence may no longer hold leading to ...
2
votes
2answers
103 views

Mean value of truncated normal distribution

I have a bunch of data where each observation represents an error $\in [0,1]$ (computed error between a variable and it's ground truth). Extra info: These are the results of the difference between a ...
1
vote
1answer
50 views

How to compare count of two groups?

I have a two groups of data - 1/ All data and 2/ Selected_season, which is only some subgroup of all data. I want to find out: a/ if proportion of BM, HB, etc. groups is the same in All data and ...