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

How to allocate questions to factors using R output?

I have the R output below, but don't know how to allocate questions to the factors. Any advice? ...
0
votes
0answers
7 views

Frequency analysis from time dependent data in R

I've got a time dependent data from animal recording. My data has two groups (TR and UT) each group has 20 replicate. Tiempo (time) variable goes from 282 sec to 318 sec. I have a turning point at 300 ...
0
votes
1answer
7 views

What is the baseline level in a factor-by-factor interaction?

What is the baseline level for a factor-by-factor interaction term in multiple regression? Consider this example from Fox 2003. In the regression below, these two variables are categorical: ...
0
votes
0answers
7 views

Mahalanobis Distances Critical Values (Chi-Squared?)

Say I work out the mahalanobis distance 'D' to measure the separation between two objects (which aren't normally distributed). Say I now want to use 'D' against some critical values to decide if it's ...
0
votes
0answers
9 views

Anova (missing F statistics), Ancova and mixed modelling on nested dataset

I am performing an analysis in R and wonder how to do it since different methods return very different results. My dataset contains Samples and SubSamples as nested random effects and Type, Dose and ...
1
vote
0answers
7 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
17 views

R: how to separate date-time data types [on hold]

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: ...
1
vote
2answers
23 views

R: how many equal letters between two strings [on hold]

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
14 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 ...
1
vote
0answers
19 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
1answer
15 views

transform probability density function

I have the numeric values to plot a probability density function....they look like ...
0
votes
1answer
10 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 ...
17
votes
4answers
417 views

Is this an appropriate method to test for seasonal effects in suicide count data?

I have 17 years (1995 to 2011) of death certificate data related to suicide deaths for a state in the U.S. There is a lot of mythology out there about suicides and the months/seasons, much of it ...
4
votes
1answer
250 views

Clustering data that has mixture of continuous and categorical variables

I have data that represent some aspect of human behavior. I want to cluster it (unsupervised) into behavioral profiles of some sort. now, some of my variables are categorical (with 2 or more ...
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
7 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
271 views

Imputation with R and MICE

A short mice-related question as follows: when running simple mice imputation the function goes through well. But complete() ...
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
vote
2answers
1k views

R package for visualizing and exploring large datasets

I recently read about a package, which I believe had a name like "tabstat" or "tablestats" which produced a really useful plot of univariate distributions of multiple variables for large datasets. I ...
-1
votes
0answers
15 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
7 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
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
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: ...
2
votes
1answer
35 views

Translating a bayesian model from MCMCpack (hregress) to JAGS

I am trying to convert a hierarchical model that currently works with the R package MCMCpack, into a JAGS version. I have experience working with regular models in JAGS, but not with hierarchical ...
1
vote
0answers
14 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, ...
1
vote
2answers
13 views
1
vote
1answer
2k views
7
votes
1answer
586 views

How do I fit a nonlinear mixed effects model for repeated measures data using nlmer()?

I am trying to analyze repeated measures data and am struggling to make it work in R. My data is essentially the following, I have two treatment groups. Every ...
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
147 views

Difference in rules via apriori() with target “frequent itemsets” and ruleInduction() and via apriori() with target “rules”

Regarding R package arules: To my understanding the Apriori algorithm works by first finding all frequent itemsets that meet the support threshold and then generate strong association rules from the ...
0
votes
0answers
17 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
1answer
334 views

R AUC never less than 0.5?

I'm doing some work with random forests in R using the randomForest package, and I've run into something that seems odd to me. Even when the data is completely ...
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
0answers
17 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 ...
2
votes
1answer
964 views

Simulate ARIMA by hand

I was working on ARIMA in R and I am trying not to use library forecast as much as possible. I have a code for finding the best ARIMA model, but it is showing some ...
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
0answers
8 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 ...
2
votes
1answer
120 views

Deriving Density Function (pdf) from Distribution Function (cdf)

A random variable $V$ has the distribution function: $$ F(v) = \begin{cases} 0, & \text{for $v<0$ } \\ 1-(1-v)^A, & \text{for $0\le v\le1$ } \\ 1,& \text{for $v>1$ } \\ \end{cases} ...
0
votes
1answer
64 views

testing for mediation of interactions

I am somewhat familiar with various ways of testing mediation for factors in different types of regression analysis. (I'm using R and currently working with a multilevel binary logistic regression.) ...
0
votes
1answer
33 views

Testing two raters' time-point data for interrater reliability

My data consists of two raters interpreting one specific phenomenon to occur at different points in time (the observations are not paired, the raters actually identified different amounts of ...
-1
votes
1answer
56 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
9 views

Experimental comparison and variants [migrated]

Could anybody explain this code from Luis Torgo (the DMwR package): ...
1
vote
1answer
138 views

R Error in chol.default(A) krigeST from gstat package

I am working with an hourly dataset of air temperature, recorded at ~200 stations over a relatively small area. I chose a space-time variogram (e.g. sum-metric) to fit my data and am now trying to ...
5
votes
2answers
256 views

Using log-linear models for presence/absence data in wildlife

I'm working on a project wherein I compare the presence/absence of a number of bird and herptile species between wetlands that have received three different treatments. The populations were surveyed ...
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 ...