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

1
vote
1answer
21 views

Cohen's d p-value meaning

I am using the package compute.es in R to calculate effect size from a t-test. The t-test is marginally significant with p=0.05657. When I run ...
0
votes
1answer
10 views

Model comparison between glm (with Firth correction), random Forest, penalised SVM

I am currently developing three models to classify features of gene sites. I was using glm (with Firth correction), random Forest and SVM to build the models and I used forward and backward ...
1
vote
2answers
21 views

Feature selection before neural network classification

I have a training set of 87 samples and 9480 variables. My predictors are continuous and my response variable is binary. I'd like to use the caret package in R to tune a neural network classification ...
1
vote
1answer
19 views

R Lasso regression for numeric outcome

I do not have experience of using LASSO regression glmnet. I wanted to use it to see which factors affect most my attribute. I have 99 factors (binomial) that affect one attribute (numeric). Is it ...
0
votes
0answers
22 views

How would you categorise a matrix into high and low levels? [on hold]

I have a matrix of data consisting of over 30000 rows and 2000 columns. My rows are different samples and my columns are different conditions that those samples were measured. I want to assign the ...
3
votes
0answers
8 views

Quasipoisson or negative binomial glmm with differing dispersion by group

I have a set of count data, which look something like this: ...
2
votes
1answer
10 views

Determine if there is a difference between two large vectors of different sizes of non-normal quantiative data in R

I have two vectors that are of unequal sizes. They contain quantitative data that does not form a normal distribution. I would like to see whether or not they are statistically different. Is there a ...
0
votes
0answers
20 views

Frailty term interpretation for coxme function [on hold]

How do you interpret the frailty terms that are outputted with the coxme function in R when using random effects? coxme(Surv(time=icu_los, event=censor)~ (1|site), data) I would like to make a ...
1
vote
0answers
18 views

What is best practise for dimensionality reduction in rows of data

I was wondering what was best practise for dimensionality reduction in observations (as opposed to features) in a data-set? I often have data comprising of a multiple, random number of observations ...
0
votes
0answers
5 views

Regression Model for Matched Continency Tables Coefficient Interpretation

Sorry to insist. A number of questions in the same direction (coefficient interpretation) by different contributors, never answered. ...
0
votes
0answers
24 views

R: How to define a distribution using CDF [on hold]

I want to use "ks.test()" to compare my data to a specific distribution defined by CDF, which to my understanding is possible. But, being new to R, I am having trouble trying to find the way to define ...
0
votes
0answers
7 views

Iterative Differential Expression Analysis for Multiple Categories

I have a dataset which consists of one categorical variable and many numerical variables. This is how my data is formatted: ...
0
votes
1answer
30 views

What transformation should be carried out if the count is non-integer in poisson glm in r?

My data is like this: person final sex 1 34.20 1 2 2.00 0 3 15.58 0 4 18.00 1 5 50.06 1 I am fitting ...
1
vote
3answers
52 views

Standard error of a population

I measure the weight of 100 people and pick 20 lots of 5 people from these 100. Therefore n = 5, repeated 20 times. The 100 people represent the population and groups of 5 people represent samples ...
0
votes
0answers
5 views

R nnet model as an equation for use in other programming languages [migrated]

I've successfully created the model in RStudio using nnet. But now I need to code it up in Java. I presume I could take the weights (wts) and build up the equations necessary for the activation ...
1
vote
1answer
20 views

Mixed Model Type-III Sums of Squares- R vs SPSS

The age old question of comparing sums of squares (SS) between programs has reared its ugly head again. I am trying to replicate output in SPSS, that was computed using Type 3 Sums of Squares, in R. ...
0
votes
0answers
24 views

Why is my frequency table different in SPSS than in R? [on hold]

I'm analyzing a 2080 person survey. Some of the questions in the survey ask people whether they would accept a given amount of money in return for allowing a power plant to be located near their ...
3
votes
2answers
32 views

Encompassing Tests to compare models in R

I recently read a paper in which an academic compared two competing models of voting theory. One of the advanced diagnostic tests he did was to try and see whether either of the models could "formally ...
0
votes
0answers
10 views

R: Automated Survival Analysis: KM to Log Rank

Below is example data where in genomicmatrix, each row corresponds to a gene ("sample"), and each cell corresponds to a value ...
0
votes
0answers
20 views

divide among the use of statistical software package [duplicate]

Most of the application done by professionals, may it be in finance, economics or other industry is done in either R, SAS or Python. From what it looks like, most of the application in industries in ...
5
votes
2answers
198 views

Timeseries analysis procedure and methods using R

I am working on a small project where we are trying to predict the prices of commodities (Oil, Aluminium, Tin, etc.) for the next 6 months. I have 12 such variables to predict and I have data from ...
2
votes
0answers
15 views

Departures from normality in factorial design

This paper (http://psycnet.apa.org/journals/med/6/4/147/) states that departures from normality can be tolerated for one-way ANOVA. "The results give strong support for the robustness of the ...
0
votes
0answers
16 views

Neuralnet function error in R [on hold]

I try to run neuralnet() in R, which have response variable as diabetes (categorical) as function of 8 predictors (with one ...
0
votes
0answers
3 views

Specifying model type in R package eHOF [migrated]

I can't figure out how to specify the model type in package eHOF (I want to plot a model other than the one chosen by the program). I create a HOF object: ...
0
votes
0answers
9 views

getting fitted lines with scatterplot matrix in r [migrated]

How do I get a scatterplot matrix which will also show the fitted lines in each plot. I know how to use "abline" function with individual plots but don't know how to implement it in a scatterplot ...
0
votes
0answers
17 views

using biomod2 package with continuous response variables

I am looking to correlate crop area with climate variables and then predict for future if suitability of crop areas will change/remain same under different climate scenarios (in line with species ...
-3
votes
0answers
53 views

About a problem of R in Linux [on hold]

When I use Rscript xxx.r to run a R script in Linux, I found that if I run it twice, the variables I used in the first time will not be kept when running the second ...
1
vote
0answers
18 views

Estimating ARIMA models in SAS [migrated]

I would like to (insert "have to") do some ARIMA modeling in SAS. Normally, I would simply use auto.arima in R and let the function choose the differencing orders and just specify whether to use AICc ...
0
votes
0answers
17 views

z test for difference between 2 proportions using R [on hold]

There is a population with 1,000,000 cases and two equal-sized groups within this population. The p for group 1 is 0.9 and p for group 2 is 0.8. Draw samples of size 500 from this population. Assess ...
0
votes
0answers
18 views

Using results of Canonical Discriminant Analysis to get overall variable importance?

I have a dataset with thousands of observations pre-assigned to 18 groups and with measures for 8 different variables. I am using canonical discriminant analysis to see how separable my 18 groups are. ...
1
vote
1answer
38 views

Finding cycles in data using a periodogram and Fast Fourier Transform

Problem: Detecting cyclical patterns in daily data using periodogram and FFT. The issue is how to code in R the periodogram to detect monthly, quarterly, semi-annual, annual..etc cyclical patterns in ...
2
votes
0answers
16 views

Regression Model for Binary Matched or Paired Contingency Table Results

This is a follow-up question on a prior thread about the same setup as follows: We have two "Methods" ("A" and "B") to diagnose a medical condition. We are not trying to determine which one is better ...
0
votes
0answers
11 views

How to include a half-Cauchy prior in a Gibbs sampler for a hierarchical model (Rubin's “8 schools”)?

In the third edition of the popular Bayesian Data Analysis, Gelman et al. discuss a variation on Rubin's "8 schools" problem in which only three schools are considered (p. 131). The authors suggest ...
4
votes
1answer
45 views

Null deviance in glm R

This is a question about the difference in calculating the null deviance in a simple Poisson model with and without an intercept. If ...
3
votes
1answer
50 views

lme4: random effects

I have a simulated data set of 4 repeated measurements (measure) for 5 subjects (subj), 20 trials (trl) each. I am trying to fit a model with random slopes for age category with subject and trials ...
0
votes
0answers
3 views

Combined bar plot and points in ggplot2 [migrated]

I would like to plot a "combined" bar plot with points. Consider to following dummy data: ...
1
vote
0answers
17 views

error for using forecasting models inside a loop in r [on hold]

I intended to automate the process of finding forecasts for every 48 hours for an hourly set of data. I simply want to read 3 years of historical data, fit a forecasting model to that and provide ...
0
votes
0answers
14 views

Questionable Output from Time Series Forecast Using MSTS and TBATS from R forecast package

Using historical daily order totals, I'm wanting to forecast the totals of the next 7 days. It's known in my field that these totals fall subject to weekly and yearly seasonal trends. Called ...
0
votes
1answer
20 views

Computing the true effect size from F-values and sample sizes?

I'm trying to extract a bunch of effect sizes from a couple of different studies in for which the authors have performed ANOVAs on their data. More specifically, I'm interested in the main effects of ...
3
votes
1answer
75 views

How is the sigma^2 value (or MSE) for the link function computed in logistic regression in R?

For example, if you have a logistic regression on certain dataset: fit <- glm(y ~ x, data = test, family = "binomial") If you do ...
0
votes
0answers
9 views

Significance of a correlation considering missing data

So I'm dealing with two timeseries, of which one contains quite some missing data (between 10-60%). I'm excluding some datasets which contain exceptional much missing data, but still I would like to ...
1
vote
1answer
52 views

How to document a Random Forest result (final model)?

Using Random Forest to predict dichotomous variables (for classification) I encountered the problem how to best document this model, i.e. I want the user to reproduce/use the final model I created on ...
0
votes
0answers
38 views

Misfitting of drift rate in Wiener model

In a binary-decision experiment, the accuracy and response time of some subjects were recorded. My goal is to fit a Wiener model to response time and accuracy data. The binary experiment has three ...
0
votes
0answers
16 views

R programming. Finding efficient frontier using Black Litterman Model

I'm trying to get Efficient frontier Using Black Litterman model. I'm getting only optimal portfolio using BLCOP Package and i have used this function ...
2
votes
1answer
34 views

simulating data with a lot of predefined constraints in R

how to simulate data (in R) to generate , sample values 1) variables with specific correlation values for a particular model AND 2) with predefined regression coefficients? 3) Can we also set the ...
0
votes
0answers
34 views

R binomial family with identity link

I want to fit a linear model by R with family=binomial(link="identity"), however, binomial family do not have identity link. What should I do?
0
votes
0answers
47 views

How to calculate confidence intervals in R and then plot them? [on hold]

I want to be able to print confidence bands around the dots of the plot for the following data ...
0
votes
0answers
5 views

Accounting for initial values of reponse variable in binomial GLM

R v.3.1.0. Mac OSX 10.9.5. Can somebody please recommend a method to account for initial values of a response variable in binomial GLMM? I am designing an ecological experiment, and am having a hard ...
0
votes
0answers
7 views

Extract ETS method used for automatic forecasts of hierarchical time series with hts package [migrated]

I'm trying to extract the ETS method that is automatically chosen when we apply the forecast function to an hierarchical time series using the hts R package. When I look in the structure of the ...
2
votes
0answers
25 views
+50

Examining trends with interactions and with stratification - obtaining discordant results

I'm examining the effect of income (categorized into quintiles) on a response variable during different years (from 1996 to 2014). I adjust for some other covariates and have repeated measurements on ...