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

Variance matrix for model errors

I am having trouble with understanding how can I write out the variance matrix for model residuals. I have a very simple data with 6 observations: ...
0
votes
1answer
6 views

R: how to separate date-time data types

My data set is "weather": I need to calculate the average time and date. First I tried to separate the date and time into to different columns by: ...
0
votes
0answers
7 views

What are the best packages for Image Processing in R?

I just have started working on an image processing and classification problem. I am familiar with both R and Python. But I am not much experienced in scikit-learn and scikit-image libraries in Python. ...
0
votes
2answers
11 views

R: how many equal letters between two strings

I have 2 strings: "aaaabbC" and "adgfccc" I want to know how many letters appear both in the first and second string (and not how many times a letter apears) in my example, the answer will be: 2 ...
0
votes
1answer
6 views

beta-binomial distribution with R

I am studying an experiment of the kind: Let $n_{ij}$ be the number of fetuses, $X_{ij}$ the number of responses i.e. the number of fetuses with a malformation in the jth litter of the ith dose level ...
0
votes
0answers
6 views

Smoothing Kernel Preventing Simulation of Semi-Circle Law of Random Matrices

In trying to understand the properties of random matrices in the book "Plane Answers to Complex Questions" by R.Christensen, I came across the Semi-Circle Law, and tried to reproduce it with ...
0
votes
1answer
14 views

Blocks in a given numeric vector [on hold]

Given a sequence of integers: 1,1,2,3,1,3,4,5,6,2,2,2,7. It is required to report the no. of occurrences of each integer {1,2,3,4,5,6,7} but block-wise. Block-wise means an integer occurring in the ...
-1
votes
0answers
13 views

how to divide my categorical data into three clusters [on hold]

I have some data of 10 attributes, all of which are categorical attributes (factors in R). I would like to divide this data into three homogeneous sets(clusters). I went about doing 3-means ...
0
votes
0answers
14 views

R - replace TRUE with actual value [on hold]

My goal is to mark the values in plot if the value of jj is less than min_threshold and greater than ...
0
votes
0answers
6 views

Algorithm and R code for dealing with ties in Wilcoxon rank-sum test

1) I think one of the algorithms used to handle ties for the Wilcoxon rank-sum test (a.k.a. Mann-Whitney U test) is Streitberg / Rohmel. I could not find a good source which explains the algorithm/ ...
0
votes
0answers
3 views

Model diagnostic tests for local linear regression

What are some of the model diagnostic tests which are used/ would be suitable to use for a local linear regression model? Note that this is not the least squares linear model, but rather a special ...
0
votes
0answers
5 views

How to interpret a multilevel model that repeats variables for fixed and random effects (like in MCMhregress)?

I came across a specification of a multilevel model that I'd never seen before. It looks like the R function MCMChregress (see: ...
1
vote
0answers
13 views

Binomial data: Null Hypothesis $p = 0$ when all Sample Values are 0 - testing and power analysis

I am trying to investigate if the proportion of successes in my population can be shown to be larger than zero. Thus, $H_0: p = 0$ and $H_A: p>0$. Since $p=0$, the prop.test in R does not work, ...
0
votes
0answers
15 views

Visualise variance partitioning [on hold]

Can anyone suggest any ways of visualising variance partitioning in R? Can anyone provide code or point me in the direction of books/web pages that provide R code to visualise variance partitioning?
0
votes
1answer
10 views

transform probability density function

I have the numeric values to plot a probability density function....they look like ...
5
votes
1answer
38 views

syntax for nls model with breakpoint

So I am trying to fit the model $$Runoff = \begin{cases} \beta_0 + \beta_1Pcp & \text{if $(Ant + Pcp) < Thold$;}\\ \beta_2 + \beta_3Pcp & \text{if $(Ant + Pcp) \geq Thold$;} \end{cases}$$ ...
0
votes
0answers
15 views

Error message eval(expr, envir, enclos) object 'X1914' not found [on hold]

I have been given two data frames x and y which I used to create two separate corpus ( corpora) Data frame X, has the dependent variable while Y, is the test set with similar variables and headings ...
0
votes
0answers
19 views

performing OCR in R [on hold]

I am going to have images of dials as below. I want to extract text using R. In past i have taken "machine learning" course offered by Prof Andrew Ng on Coursesa. As per that course, the main parts ...
0
votes
0answers
8 views

How to merge two datasets in R? [migrated]

Okai, so i'm a pretty decent R- programmer, working in it like 3/5 days a week and for the last week I ran into a rather unique problem. I work in R-studio, where I was unable to merge the datasets ...
1
vote
0answers
16 views

Forecasting one dataset using data and correlation from another using R: commercial centers entrances and restaurant sales figures

Please, be kind, as I'm totally noob in stats and R... I'm the owner of a small restaurant in a commercial center, and I managedd to collect two main dataset, commercial-center (cc) and restaurant ...
0
votes
0answers
6 views

relationship between power means and population zscore calculations

Can one use a power mean of the ages in a room to determine the age break down of a room? Let's say you have a room full of people, by using the average age and standard deviation of the age, how do ...
0
votes
2answers
19 views

Statistical test to compare paired scores

I would like to measure (to quantify with a statistical test) how much different are paired scores. For example: for gene "x" I performed an experiment with technology A that gives a score, then for ...
0
votes
0answers
7 views

Choosing weights for linear regression lm in R for time decay?

I am modeling server performance. Basically load~hits. I want the older hits data to have less influence than newer because overtime different optimization and code have been installed/applied. In R, ...
0
votes
0answers
27 views

Quantiles in R for two-dimensional data

I have a two-dimenstional data set, which consists of "values" in the one column $V$ and "numberOfOccurrences" in the other column $W$. Hence, for each observed value, it is recorded how often that ...
0
votes
0answers
9 views

Experimental comparison and variants [migrated]

Could anybody explain this code from Luis Torgo (the DMwR package): ...
0
votes
0answers
14 views

R - quadprog package for constrained Lasso (penalized) linear regression

What I am doing so far: I am doing a constraint linear regression with R's quadprog package, function solve.QP(). The ...
1
vote
2answers
102 views

Multivariate Data

There is a built-in data set USArrests data in R software . ?USArrests We use this ...
0
votes
0answers
11 views

“Factorial” Profile Analysis, does it exist? Or is there maybe a better statistical method I should be using?

I am working on a visual search project that I created in Psychtoolbox with Matlab. As with most visual search studies, there will be within subjects tests, since each subject completes many trials. ...
0
votes
1answer
19 views

Confused about how to run MCMC using OpenBUGS [on hold]

I am running the code below: ...
1
vote
2answers
13 views

Dealing with studies with no cases in meta-analysis

I am meta-analysising the following data by age range: ...
-1
votes
1answer
54 views

Do probabilities need to sum to 1 in a choice model? [on hold]

We're create a discrete choice model, in which there are more than two alternative choices. There are some options for this, such as the multinomial logit and the conditional logit.. We started with ...
0
votes
0answers
32 views

one way anova in R

I have only just started using R in my first year at university and I am completely stuck. I have done an anova test as the data is normally distributed and parametric. However, this is my result. I'm ...
0
votes
1answer
31 views

Normality test for large samples

So I working on a programming assignment that uses multiple algorithms to solve the floodit game. I have taken some of my data that I have collected thus far. I did a shapiro test: ...
0
votes
0answers
7 views

plot does not show up for an svm object and no error is returned as well [migrated]

I am trying to use svm() to classify my data. A sample of my data is as follows: ...
0
votes
0answers
3 views

R: Formula with multiple Conditions and Categorized Surface Plot [migrated]

I want to make 3D plots for linear Regression Models in R: I wish to display surface of the regression plane of a linear model. I have 2 continuous variables (say AGE, HEIGHT) and 2 factors (SEX, ...
0
votes
1answer
9 views

What is the difference between the standard errors calculated by predict.lm() and summary.lm()

I am trying to calculate standard errors of group means for a two-way-anova. I found two ways to do this (predict.lm(, se = T) and ...
0
votes
0answers
13 views

How to interpret factor by factor interactions?

I'm a bit confused on how one should interpret factor by factor interactions, and what interpretations can be validly extracted. Consider this example from Fox 2003. In the regression below, these ...
0
votes
0answers
6 views

R Multivariate polynomials parameters (polym function) [migrated]

I am looking for the best fit for some data containing three variables: x, y, m, by using R. For that I use the function "polym" like: ...
1
vote
0answers
13 views

How does glmmlass work for Linear Mixed effect model?

When I used the glmmlasso for a linear mixed model (gaussian), I got a warning message: ...
1
vote
1answer
59 views

R and Regression: How to determine distribution of residuals?

I have residuals from a linear regression model on my data set. I want to find an appropriate distribution of my residuals. Say, I assume my residuals are Skew-T Distributed, how can I find the ...
0
votes
0answers
5 views

Plot influence function of a datapoint [on hold]

I was wondering whether there is a command in R that allows to plot the influence function of a datapoint for a certain estimator. I have been looking for this all day but I seem not to find it. All ...
0
votes
1answer
29 views

Powering a study to show differences in variance, e.g. in R?

I'm hoping to do a study to calculate whether 1 method of measurement is more variable than another in a subgroup of patients. I assume this will be done with an F-test, from some reading? However, ...
2
votes
0answers
24 views

How does the presence of factors affect the interpretation of the other coefficients in a regression?

The answer to Interpreting coefficients of an interaction between categorical and continuous variable contains a phrase that seems to have some significant impact on how coefficients are interpreted ...
0
votes
1answer
37 views

How is the error calculated in ETS using R?

I'm trying to replicate the ETS algorithms from R in Excel using the formulas present in the link below. https://www.otexts.org/fpp/7/7 According to my research the error is supposed to be ...
0
votes
0answers
13 views

Error using MissMech package for handling missing data [on hold]

I am trying to determine whether my data are MCAR (Missing Completely at Random) using MissMech R Package. However, the output of the function from the package is: ...
0
votes
0answers
13 views

Prediction in longitudinal data mixed models

Suppose I have a GLMM for longitudinal based on 1000 observations. Now I want to predict the responses based on 20 more observations. How can I do it in R? I have used the lme4 package in R to ...
0
votes
0answers
39 views

R:Text Analysis and Classify as type

I am new to R and Analysis, I have content set (emails) that are stored as csv file that is of more than 1000 rows(more than one email content in a row) , these are been imported to R and have been ...
0
votes
0answers
20 views

R:Creating Document Term Matrix for particular words [on hold]

I am new to R and working on Text Analysis on Email content to classify it as particular type . I have cleaned (remove stop words, punctuation, lower case, remove numbers)the content set using ...
0
votes
0answers
10 views

R: Caret Package - Regression with (strong) confidence?

I am fairly new to using prebuilt machine learning packages in R. I am looking at the following problem. I have a long feature set, very small training set, and a large test set. The goal is to ...
0
votes
1answer
12 views

Confidence measures for Gaussian mixture models

When generating Gaussian mixture models using expectation maximization with Bayesian Information Criterion, is it necessary to report a confidence measure? How do you know that the algorithms are ...