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
0answers
6 views

Dividing a map by electoral result with R? [on hold]

I would like to divide a map of Germany vertically by the electoral results of 2013: ...
0
votes
0answers
7 views

reaching max.print on R [migrated]

I just found a bunch of weather data that I would like to play around with in glmnet in R. First I've been reading and organizing the data in R, and right now I am just trying to look at the raw data ...
0
votes
0answers
4 views

Unsupervised Clustering using randomForest

Outline of clustering technique using Random Forest A synthetic data is created by randomly sampling from the data of interest. It is used as the base line to measure the "structureness" or ...
0
votes
0answers
6 views

How can I run ordered logistic regression on a large sparse matrix in R

I have a sparse matrix X, 970283x9511, with 970283 documents and 9511 features. I have a vector y of length 970283 corresponding to a rating 1-5. I know of the glmnet package, which has binomial and ...
1
vote
0answers
9 views

Nagelkerke $R^2$ interpretation

I used logistic regression and found that my model fits well: ...
1
vote
0answers
19 views

Time Series using STS( Basic Structural Model)

I am using Basic Structs to forecast my time series. My forecast is exactly overlapping my data. I am sure no model can predict with 100% accuracy. I know I am missing something, can someone point me ...
0
votes
0answers
4 views

Error in Coocur matrix: 'x' must be numeric [migrated]

I am trying to determine species co-occurrence using cooccur package in R. My data appears to be formatted just like the example data, finches, except I keep getting a "non numeric" error when I run ...
0
votes
0answers
14 views

Assignment Problem — Constraint matrix setup

I struggle with an assignment problem. This question and @TAS answer helped me a lot, but I still have problems with the constraint matrix for my specific situation: Assign 159 workers to 11 jobs ...
0
votes
1answer
21 views

Single column plot in r versus gnuplot [on hold]

I am new to R environment. I have created a simple data set as shown below. 1 2 3 7 8 9 I simply plotted this data using both gnuplot and R. Command ...
0
votes
0answers
8 views

Different coefficients of linear discriminants with the same raw data

I have just tried two ways to perform a linear discriminant analysis. Mode 1 This is the data, divided in two tables (printed from screen using R commander): They belong respectively to the two ...
0
votes
0answers
15 views

Maximum likelihood estimation of the log-normal distribution using R [migrated]

I'm trying to estimate a linear model with a log-normal distributed error term. I already have working code for a linear model with normally distributed errors: ...
1
vote
0answers
21 views

Mahalanobis Distance - Geometric Place

Given a matrix $\mathbb{X}$ of 20 elements, representing 20 observation of a 5-variable normal, I was asked to find the Sample Mean Vector and Sample variance matrix and to find the geometric place of ...
0
votes
0answers
16 views

R how to pass a (potentially) missing argument? [migrated]

I have in R a low level function that uses the missing() construct, and would like to use a high-level/wrapper that passes some arguments to it. The problem is that even if the user does not provide ...
0
votes
0answers
15 views

How to use R to get drift rate and volatility rate of stock prices changes?

I am doing a research on the historical annual stock prices changes, where I have about 30 rows of annual stock prices. How can I use R to get the drift and volatility rate?
1
vote
1answer
15 views

Translate glmer (lme4) model specification into MCMCglmm

I am having some computational trouble estimating the following model with the glmer function in lme4: ...
0
votes
0answers
6 views

R's nnet needs decay to perform with sin() like function, why variant reproducibility

I've noticed that for sin() like data, I need to use "decay" which is available in nnet to get the ANN to perform. Why would that be in theory? Also when I run runNN(0.02) over and over, sometimes ...
0
votes
0answers
9 views

Optimize deep learning model in h2o with R [on hold]

I created a deep learning model with h2o in R. But it still has very poor performance. How can I optimise the outcome? What parameters can I how change? Is it just randomly changing parameters and see ...
0
votes
0answers
12 views
0
votes
0answers
8 views

Creating a readable matrix with a netCDF file

I'm still learning R and I'm having trouble getting R to read and organize data in a way for me to perform analysis on. I have taken data from a free online weather database here: ...
0
votes
0answers
11 views

Testing Various Hypothesis Test for Coefficients in R [migrated]

I Know in R it returns for a Multiple Regression it returns hypothesis test for $\beta_i=0$ but what if you want to test such tests like $\beta_i=1$. Is there any easy command for this or if not how ...
0
votes
1answer
43 views

P value of multiple linear regression

I have extremely large number of observations (8524152) of soil moisture, precipitation, evapotranspiration, delta precipitation, and delta evapotranspiration. I ran a multiple linear regression model ...
2
votes
1answer
51 views

Why is the p-value for Cohen's $d$ not equal to the p-value of a t-test?

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
16 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
34 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 ...
2
votes
1answer
20 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
23 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
15 views

Quasipoisson or negative binomial glmm with differing dispersion by group

I have a set of count data, which look something like this: ...
3
votes
1answer
11 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
22 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
21 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
32 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 ...
2
votes
3answers
65 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
22 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
34 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 ...
7
votes
2answers
231 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
22 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
19 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 ...