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
33 views

Correlation Between 2 uneven samples size

I am trying to determine the correlation between an observed and theoretical set of data. Both sets of information are in the form of a table of deflection against time. Both samples have the same ...
0
votes
1answer
54 views

Linear regresson lm or stepwise regression here using R?

It is a basic question but I could not find clear answer on my reading. I am trying to find independent predictors of Infant.Mortality in data frame 'swiss' in R. ...
0
votes
0answers
23 views

R - basic multiple imputation with the mi package

Consider the following R code: ...
0
votes
0answers
14 views

Trying to understand output of spectrum function

The spectrum function in R is supposed to return the power spectrum of input signal which is simply the square of the magnitude of the fourier transform. Given ...
1
vote
1answer
56 views

Specifying Cross-Level Interactions in LMER

I am trying to figure out if it's okay to specify cross-level interactions in a hierarchical model with fixed effect predictor variables at both levels using the ...
0
votes
0answers
13 views

Friedman's test help in R

I'm trying to figure out Friedman's test in R and am confused by some of the output. For example, consider two groups where the ranks are reversed. Thus Group 1 goes from 1:40, then group 2 goes from ...
3
votes
3answers
99 views

How to fit regression to custom model in R

This is for my honors thesis. I have a large data set, of which I'm sharing only what I call the "Low phosphorus" series: ...
0
votes
0answers
9 views

Specifying Cross-Level Interactions in LMER [duplicate]

I am trying to figure out if it's okay to specify cross-level interactions in a hierarchical model with fixed effect predictor variables at both levels using the lmer function, and, if so, how to do ...
0
votes
1answer
15 views

Rpart using Caret changes names of Factors

If I have a factor e.g. sexe with two levels MALE and FEMELLE let's say, using rpart alone I get splits that say for example Sexe = Male and then a yes no split. However using rpart with caret I get a ...
-2
votes
1answer
39 views

How to make a vertical line in R [closed]

curve(dnorm(x,90,10),from=60, to=120) I need to make some vertical line in the x line that in number 70 and 110. How should I do it?
0
votes
0answers
25 views

GEE and post hoc comparisons

I am trying to analyze a dataset using the GEE. This is what I have so far ...
0
votes
0answers
13 views

How to Interpret coefficients of a beta regression model with logit link

I'm running a beta regression in R where the outcome variable is continuous but bounded between 0-1. I need the results to be understandable to an audience with a ...
0
votes
0answers
14 views

algorithm to predict cost function

The goal of problem is to predict the weight for missing data . I have a dataset of categorical type as shown below ...
0
votes
0answers
9 views

Error using “cengaussian” family with MCMCglmm

I'm trying to run a model using a cengaussian family distribution with the function MCMCglmm. The model is: ...
0
votes
2answers
47 views

Different results from several “passes” of Random Forest on same dataset

I've been playing around with the German Credit dataset available in Kuhn & Johnson's caret package for ...
2
votes
1answer
37 views

Interpretation of logged regression

I have run a linear regression with the following equation (in r): lm(formula = logTotal ~ Continent + logArea + Method + Servs) where ...
0
votes
0answers
24 views

comparing two sets of meta-analysis

I have two subgroups (high / low BMI) on which several measures where recorded and analyzed on by various papers in a treatment and a control group. I was trying to verify if, for each measure, the ...
1
vote
0answers
28 views

Interpreting and reporting gamm4 result

I am new to gam, and most of my knowledge comes from this document http://www3.nd.edu/~mclark19/learn/GAMS.pdf. Now I am using generalized addictive model with random effects to model some data, where ...
0
votes
0answers
39 views

strange loadings matrix after varimax rotation: PCA with prcomp in R

I'm running a PCA using the R function prcomp. This is the function: d2.pca <- prcomp(sel.d2,center = TRUE,scale. = TRUE) So variables are scaled an centered ...
0
votes
1answer
33 views

How to ReSample the Training DataSet

I have a training dataset which differs significantly on several parameters (t-test/f-test) with the test set (for which the labels are not known to me.). I am thinking of re-sampling from the ...
1
vote
1answer
43 views

3D surface plot for least square & ridge regression

I'm very impressed by this plot: Why does ridge estimate become better than OLS by adding a constant to the diagonal? Does someone has any clue about how to plot this on R? I mean, how to get RSS ...
0
votes
0answers
17 views

Regression using indicator variables and time t. (R code) [duplicate]

I'm having difficulties setting regression R code.... This is the data that I need to use: ...
0
votes
2answers
35 views

Will RandomForest model work well if the correlation lies between the given attributes

Currently I am working on the data mining project and I am using RandomForest classification model for that. I have a few queries in that. Will the RandomForest handle if there is correlation ...
0
votes
0answers
13 views

Regression using indicator variables and time t. (R code)

I'm having difficulties setting regression R code.... This is the data that I need to use: ...
1
vote
0answers
18 views

how to fit nlmer non-linear mixed model and have asymptote fixed?

I'm trying to compare the model where asymptote value varies over subject and the one that does not. I've fit the first (the one that varies) but can't seem to figure out the latter. The first one is ...
0
votes
0answers
18 views

appropriate sample size to fit non-normal distribution parameters

I have a population that, in theory, I could determine exactly. I am not doing so, however, because on my poor home computer, it would be too computationally intensive. Each calculation takes 45-90 ...
6
votes
2answers
400 views

Why doesn't runif generate the same result every time?

Why is it that random number generators like runif() in R don't generate the same result every time? For example: ...
0
votes
2answers
71 views
+50

random forest variables importance with continuos and categorical variables and unbalanced output

I am a bit lost in the literature regarding the random forest importance. I am aware that there are different methods. I have a binary output variables where elements labelled with 0 are much ...
0
votes
0answers
7 views

Bi-normal separation feature selection (BNS) in R

I'm doing binary classification on highly dimensional text data, with a biased class distribution. After reading this paper, i found out about BNS feature selection. Is there any package that ...
1
vote
0answers
22 views

How to program automated shrinkage for a subset of terms in R?

I've got data from a randomized experiment that includes a lot of covariates. I'm interested $\delta$ from a model of the form $y = g(\delta T + X'\beta+ \epsilon)$, where $T$ is randomly assigned and ...
1
vote
0answers
20 views

Error in gnls step halving factor

I am getting an error running a gnls() on some data I have. I was able to converge using nlsLM(), but I ran into some autocorrelation in my errors, so I want to try to use gnls() so that I will be ...
2
votes
0answers
24 views

R programming, correlation of quantitave variables with one qualitative variable

I have a flat CSV file that has one column of student names, one column of grades (outcomes) coded as a factor A-F, and about 100 columns of test scores (independent variables) of various sorts, on ...
0
votes
0answers
14 views

R plotrix and thigmophobe.labels: label falls of plot. How to fix? [closed]

I'm new to R so be gentle with me. In the documentation: http://www.inside-r.org/packages/cran/plotrix/docs/thigmophobe.labels It says thigmophobe.labels will sometimes place a label off the ...
0
votes
0answers
9 views

How to interpret Distance Correlation

I have two columns with continuous data, one ranging from 500-600 and other from 700 -900. Both the values decrease at end. There are 400 records. Now if I use distance correlation function i get ...
-1
votes
0answers
16 views

How to get names instead of serial numbers in the prediction results? [migrated]

I have built a predictive model using bayesglm that predicts attrition and gives out the prediction results as either 0(employee would leave the job) or 1(employee wont leave the job). so the test ...
0
votes
2answers
35 views

Finding an interested value in a categorized variable

Could please someone answer me how to solve the following problem. A very small part of my dataset is: ...
1
vote
1answer
35 views

Regression model for ordinal dependent variable and catogrical independent variables

If I'm using R, which regression model should I use for my dataset? (I need to get the R-squared value.) I have 1 dependent variable and 6 independent variables as follows: 1 dependent variable: ...
2
votes
2answers
38 views

Archimedean copula parameters?

Using R, I am attempting to fit data for 3 stock indices using 3 Archimedean copulas, Frank, Gumbel or Clayton. What are their parameters? In class, we were taught to fit a t copula. Its parameters ...
0
votes
0answers
2 views

R - numcolwise(sum) results cast to integers in knitr [migrated]

I am working with knitr to produce an HTML file. complete.data.by.date = ddply(complete.data, .(date), numcolwise(sum)) I use the previous chunk of code to ...
1
vote
0answers
18 views

Using standard machine learning tools on left-censored data

I'm developing a forecasting application whose purpose is to allow an importer to forecast demand for its products from its customer network of distributors. Sales figures are a pretty good proxy for ...
0
votes
2answers
37 views

Magnitude of standardized coefficients (beta) in multiple linear regression

Being aware of that article, I am curious about the question how big standardized coefficients can get. I had a discussion with my professor about that issue and she was arguing standardized ...
1
vote
2answers
37 views

Handle missing values in factor variable

I have a huge dataset for a binary classification problem (about 1.5 million rows), and the feature space is quite large (145 dimension). Some of these features are factors (YES, NO), but there is ...
0
votes
0answers
31 views

PCA on spatial precipitation data time series

I have precipitation time series data stored in a 3D matrix called 'pre' (dim1/2=position (index), dim3=time). I want to do a principal component analysis in order to detect the main variance and thus ...
0
votes
0answers
43 views

What is the multivariate analog of the median?

There is a univariate mean: sum the points and divide by the count. There is a multivariate mean analog - the centroid, a point in a multidimensional space. (1). For the median one sorts the list ...
0
votes
0answers
10 views

R Cramer Von Mises test

I am using the cramer's test in R using the "cramer" package. There are some options for the kind of Monte-Carlo-bootstrap or eigenvalue (ordinary, permutation and eigenvalue) and the kernel (Cramer, ...
4
votes
1answer
38 views

What statistical test is performed by summary(glht(model, linfct=mcp(factor=“Tukey”)), test=adjusted(type=“none”))?

I have data that I have fit using lme with the following structure (Subject is implemented as a random effect in order to account for multiple paired comparisons): ...
0
votes
0answers
6 views

Estimate standardized coefficients (beta) using lm.beta() from package 'QuantPsyc' [migrated]

I want to estimate the standardized coefficients (beta) from a multiple linear regression object using lm() function in R. I use the lm.beta() function from the package 'QuantPsyc', but I do get a ...
3
votes
2answers
206 views

2D projection to maximise separability

I have a set of 500 points in 5D. Each point belongs to one of five classes, and the class labels are known. I’d like to visualise the dataset in 2D such that the classes would be separated as much ...
2
votes
1answer
34 views

Big difference in p-value from permutation test

I have roughly 60 values of discrete temperature satisfaction votes ranging from 0 to 4. In the figure below I have grouped the votes depending on the daily number of hours the individual occupants ...