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
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
17 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
17 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
36 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
36 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 ...
-1
votes
1answer
45 views

Identify Statistical change points in R [closed]

I have a CSV file with a number of features over a period of time. (time series data). I used ggplot() to plot a line graph using the command...
3
votes
2answers
201 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
33 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 ...
1
vote
0answers
18 views

Fitting two different mixture distributions

is there a package in R to fit two different mixture distributions in R ? Let's say I want to fit a mixture of power law distribution and lognormal distribution. Is this possible ? I know you can fit ...
0
votes
0answers
19 views

Validating feature patterns of subgroups in clustering

I am trying to identify the typical developmental trajectories that participants follow in a learning task. The data set includes the performance of 1,000 learners over 10 trials each and, say, looks ...
0
votes
1answer
19 views

Bivariate Kernel Density plot

Suppose that I have two variables, $X$ and $Y$ that I want to correlate, i.e. in the manner of a scatterplot of $(X_i,Y_i)$. But I also want to show the density of each variable. A scatterplot ...
1
vote
0answers
32 views

questions on characterizing a variable into ordered, categorical or continuous

When building the regression models, some independent variables are of the following type x={1, 2, -100.1, 200.1, 300, 0, 0, 0, 0, 4000} If there exists an ...
1
vote
1answer
63 views

ARIMAX with a specified nonlinear model using the arima function in R

I am interested in fitting an ARIMAX model using R. As known, ARIMAX can be understood as a composition of ARIMA models and regression models with exogenous (independent) variables. I have a time ...
0
votes
0answers
10 views

randomForest sample size value formula

This question has been asked previously, but the answer didn't contain a formula - only a rule of thumb heuristic. Is there a formula or rule that exists for determining the appropriate sample size ...
0
votes
1answer
52 views

optimal binning in R

SPSS has an optimal binning function that helps categorizing into meaningful intervals continuous predictors when a binary response variable exists. I was looking for an equivalent function in R but ...
2
votes
0answers
45 views
+50

Predicting Y from a regression model for dY

I have some time series data where I'm modelling temperature as a function of various predictors. On physical grounds, I can expect that $$\frac{dT}{dt} \propto T_a - T$$ where $T_a$ is the ambient ...
0
votes
0answers
16 views

How to do optimization using asymmetrical loss functions (LINEX)

Long time Lurker, first time asking. For a research paper, i'm required to optimize some parameters of a certain function using an asymmetrical loss function, specifically LINEX and compare it to the ...
1
vote
2answers
47 views

Time series with autoregressive error

How can I in R fit a time series, $x_t$, with external regressors, $v_t$, and an autoregressive error? This time series model is given as follows, $x_t = \beta v_t + \epsilon_t$ where $\epsilon_t = ...
0
votes
1answer
41 views

Measuring longitudinal data where individuals have missing observations

We have a longitudinal panel of X users with their online spending patterns and are trying to measure certain metrics within the panel. We have time series information about the users such as their ...
2
votes
2answers
104 views

Simplifying variable effects in a GLM in R

Apologies, but it looks like my question is off topic for this forum. Thanks for all the excellent replies though. For those who have come across this question if they've been looking for something ...
1
vote
0answers
23 views

Longitudinal data analysis, effect of different treatments on movement behaviour

I did a playback experiment with 4 different treatments (M, R, MR, ...
1
vote
2answers
51 views

Forcing nlme to give the results for the levels of a treatment as “absolute” values instead of contrasts

I am using a nonlinear model to fit an equation to data using nlme in R. Several values (one by treatment) are estimated for a fixed effect. As usual, by default ...
0
votes
0answers
18 views

Setting minimum changepoints in R

I'm using: multiple.meanvar.exp() In R for changepoint analyses. Is there any way to force a MINIMUM number of changepoints? (I'm aware of the maximum param) ...
1
vote
1answer
31 views

Calculation of the expectation of a posterior distribution using numerical integration methods

I want to calculate the expectation of the following posterior distribution: $$E( \theta \mid {\bf u} ) = \int\limits_{ - \infty }^\infty \theta \cdot g(\theta \mid {\bf u} )\,d\theta $$ and if ...
0
votes
0answers
17 views

understanding MRT (package::MVPARTwrap) output

who can help me understand a MRT output (relevant parts see below) in R. I'm analysing a dataset with over 300 predator stomachs (between 1980 and 2012), we found roughly 30 fish species of which one ...
0
votes
1answer
31 views

Multivariate Time Series Forecasting in R - data in 10 minute intervals

I have data where an observation was made in 10 minute intervals for 8 weeks. I have around 170 variables that were measured every 10 minutes. I am trying to use multivariate time series analysis to ...
1
vote
0answers
48 views

help with constrained optimization setup in R

I have a function which parameters I wish to optimize. As a simplified example, the function looks something like this: ...
0
votes
0answers
21 views

How do I write a function to draw histogram in R? [migrated]

I want to write a function that takes in the variables from a data frame as arguments and prints the corresponding histogram for that variable in R. I have been trying to make use of hist() function ...
2
votes
0answers
22 views

Difference in Chi-square calculated by anova from cph and coxph

Is there a difference between Chi-square (from coxph -> anova) and Wald Chi-square (from cph ...
0
votes
0answers
57 views

Robust regression in R

I've used an ordinary least square linear regression model in R that looks something like this: ols <- lm(DV ~ IV1 + IV2) When I type this: ...
2
votes
1answer
75 views

Mixed effects model with repeated measures

I was trying to work out this on my own but I find myself overwhelmed. I am looking at the amount of moisture present in forest fuels (FMC) following forest thinning. Forest fuels are classified by ...
2
votes
0answers
39 views

How to predict the winner in a set?

At the moment I am dealing with some kind of supervised regression problem, which differs from the stuff I have found on the internet. So here's what the data looks like. (I am working with R) I ...
0
votes
1answer
33 views

Compare Machine Score and Human Score using R

This is a part of my research work. I have collected three human raters scores for an essay question(N=54). I am building Automated Scoring Algorithm. So I need to compare my machine score with the ...
3
votes
4answers
79 views

Sample selection algorithms to ensure that training & validation sets are representative

Currently, I am encountering a question, which is how to selection representative samples (training set and test set, even validation set) from the whole data set? I would like build a classification ...
0
votes
0answers
32 views

Plotting the effect of a variable estimated by a regression model fit

Plotting the effect of a variable estimated by a regression model fit is quite interesting. However, I have some questions regarding this subject. Here is some example code: ...
0
votes
0answers
53 views

Performing a factor analysis on categorical data

Let's say that I have the following data on banner advertisements and I want to understand what 'factors' exist within the data. Due to many of the variables being 'similar', I can't use linear ...