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

Which distribution should I use when building a GAM in R?

What type of distribution would you consider this data to be? My first thought is an f-distribution, but I suppose it could also be a poisson distribution. I am trying to build a generalized additive ...
0
votes
1answer
9 views

linear model trace of the hat matrix in R

This question is about the difference between the sum of lm.influence(model)$hat and the trace of the Hat-Matrix $H := X (X' X)^{-1} X'$ calculated "by hand". ...
0
votes
0answers
13 views

Using the curve function in R [on hold]

I use R for constructing hypothesis tests. $H_0:p==p_0=0.5$ and $H_1:p=p_1=>0.5$ I have found the power of the test to be 0.025 Now, I want to use the R function curve in order to plot the power ...
1
vote
0answers
12 views

R lmer Model Diagnosis qqnorm

I fitted this lmer model: m1 <- lmer(logR ~ N_g.m.2 * Year + (1|Wh/N_g.m.2), data = CO2_Ratio) Rendering the attached qqplot. ...
2
votes
0answers
15 views

QQ plot for log-logistic and 2 parameter exponential in r

Is there any package in R, which help us to plot QQ plot for log logistic distribution and 2 parameter exponential distribution? What methodology can be adopted for the same?
0
votes
0answers
8 views

Outer crossvalidation cycle in caret package (R)?

Could somebody provide a nice example code how to best implement an outer crossvalidation cycle using the caret package in R? The package provides a convenient trainControl() argument to ajust the ...
-1
votes
0answers
16 views

Box-plot in R with several groups and two-group comparison [on hold]

How can I create this horizontal line showing two group comparison in box-plot with several groups: http://openi.nlm.nih.gov/imgs/512/318/2699850/2699850_zdb0070957700001.png Apparently boxplot ...
0
votes
0answers
6 views

Implementing the M-test of Fuchs and Kenett in R

I'm currently implementing the M-test of Fuchs and Kenett. The goal is to determine whether a random vector $n$ could have been generated by a given multinomial distribution $p^{(0)}$. My question is ...
0
votes
0answers
11 views
0
votes
2answers
29 views

Hypothesis testing using R

...
0
votes
0answers
14 views

How to write and read matrix from file without column names? [migrated]

A matrix Aexample is: ...
0
votes
0answers
16 views

How to find the critical value for a test using R [on hold]

I am trying to construct a hypothesis test using R. I want a significant level of about 0.05. How can I find the critical value that I would you choose ? I know that I can use pbinom in order to ...
0
votes
0answers
12 views

Principal component analysis in GEO2R

I'm interested in doing a principal component analysis on a microarray dataset from the Gene expression omnibus website. Right now I am using the GEO2R GUI on the website, but I'm not sure how I would ...
-1
votes
1answer
15 views

Does polr require all dependent factors to be numeric

This is my first try at any regression and unfortunately I'm starting with an ordered logit model using the polr function in R. Does ...
0
votes
0answers
5 views

Comparing Learning Rates using Unit Curve in R

I have data for an experiment where 2 groups (Role) were tested over 3 consecutive trials for a task and time to complete task was recorded in sec. I wanted to compare the learning curves of the two ...
0
votes
0answers
16 views

Choosing a Model for Inference

I'm trying to understand what factors contribute to the a certain outcome which is a ordered factor variable. In order to just understand which factor is statistically more significant than the ...
5
votes
2answers
64 views

How can you test homogeneity of variance of two groups with different sample sizes?

I have two groups of data that have different sample sizes and in order to be able to analyze both sets they must have the same variance. I was told I should use Bartlett's to test the homogeneity of ...
1
vote
0answers
21 views

approaches for computing confidence band and prediction band for general regression analysis and predictive models

In linear regression model, the predict in R is able to calculate the confidence band and ...
0
votes
0answers
17 views

Pooled likelihood in R, how to code it? [migrated]

I don't really know how to construct the following likelihood in R. I have panel data for several individuals. Each individual is observed over time and I have several observations for each ...
0
votes
1answer
23 views

Post Hoc test after lme [on hold]

I am trying to run a Post Hoc test (glht) after a linear mixed model (lme) in R. I was ...
0
votes
0answers
11 views

quadratic endogenous variables in R

As part of ongoing research I'm to test a certain model on some data. One of the questions asked (c.f. one of the hypotheses) involves estimating the quadratic term of an independent variable (in R). ...
0
votes
0answers
6 views

e1071: does the tune function do the scaling?

I'm using tune to choose the optimal gamma and cost hyperparameters for a RBF SVM. As feature scaling is essential, my question is: does the tune function do the scaling?
3
votes
0answers
41 views

Q: Exploratory factor analysis in R

I am trying to do an exploratory factor analysis (EFA) in R with oblique (promax) rotation. From Wikipedia, In oblique rotation, one gets both a pattern matrix and a structure matrix. The ...
0
votes
0answers
25 views

Need help with multivariate multiple regression models [duplicate]

I want to predict more than one dependent variable by running one model, I thought that we can use Multivariate Multiple Regression Model. But I don't know how to do it with Excel or R. Can anyone ...
0
votes
0answers
18 views

optim() for multi variable returns values on the boundary in R

I would like to use function optim() in R to minimise the target function. The two optimised parameters both have constrains. I have created a test sampel data. ...
4
votes
1answer
34 views

How to implement reduced-rank regression in R?

How can I fit reduced-rank regression with continuous response in R? I found the package VGAM but it only fits for discrete distributions...
0
votes
0answers
3 views

Conditionally remove rows that match in column A, based on column B in R using data.table [migrated]

Trying to fix a de-duplication problem using data.table in R. Column A is a list of names, some of which appear multiple times. Column B is a list of dates. There are a bunch of other columns that I ...
0
votes
0answers
6 views

EM convergence when using em.hmm from PLIS

I use em.hmm function from PLIS package. I tried it on dimensions in range from 2 to 6. In every case of provided data (z-values) EM algorithm does not converge for dimensions 2, 5, 6. So, I wonder ...
0
votes
0answers
5 views

find optimal parameters for SVM from tune() in R= [migrated]

I am optimizing the gamma and cost variable using the tune function ...
0
votes
0answers
8 views

assign asymmetric cost in SVM classification in R?

I know that we can set a symmetric cost in R for svm,how do we set an asymmetric cost? I want to do a grid optimization like the following: ...
4
votes
0answers
22 views

What is the “pdm” stat in the “rms” R package?

I am new to the world of Regression in statistics and I have been doing a research in which I am building an ordinal logistic regression model (ORM). In order to fit my ORM model, I am using the 'orm' ...
0
votes
1answer
13 views

Benjamini-Hochberg and GEO2R

I'm currently using GEO2R to analyze a microarray data set. There is an option to generate the 250 most statistically significant genes, which calculates an adjusted p-value using the ...
1
vote
1answer
34 views

R adds unexpected variable to interaction model

Not sure if this is more of a programming question (in which case please move to stack overflow) or a statistical model question (in which case, please read on!) I'm exploring a data set and doing ...
0
votes
0answers
10 views

R: “weights” option will help calibrating class inequality?

I have a database with a binary response variable and 100 predictors (correlated and uncorrelated). I want to try the machine learning techniques in R I've been reading about in the last 3 weeks ...
0
votes
0answers
11 views

Analysis of Beetle Community in R

I'm working on my thesis but I have a problem making the last analysis. I have 4 different kind of forest: a, b, c and d each kind of forest has been analyzed in 15 different places (so we have a1, ...
0
votes
0answers
28 views

How can I create a linear regression model with some negative coefficients in R? [duplicate]

What I'm trying to do is to construct a linear model in a form like $$ Y = \beta_0X_0-\beta_1X_1+\beta_2X_2 + \beta_3 $$ where $\beta_0$, $\beta_1$ and $\beta_2$ are coefficient of predictors $X_0$, ...
0
votes
0answers
22 views

faster alternatives to solve() in R [migrated]

If chol2inv(chol(matrix)) is not applicable to my matrix (i.e. not positive-definite square matrix), is there any other alternative methods in R to do matrix inversion (or avoiding the inversion). I ...
0
votes
1answer
20 views

How can I block by location in R?

Still new and learning how to use R, but I'd like to get some help with figuring out how to block my data by location. I found this tutorial, but I don't understand where to put my data into the ...
0
votes
1answer
43 views

R - Creating conditional variables with loop [on hold]

I have a dataset like this, where each data point has a person's gender, and whether they checked off a number of descriptors (1) or not (NA): ...
0
votes
0answers
6 views

Is there a minimum sample size for Besag's transformation of Ripley's K-function?

I am using Besag's L function to test complete spatial randomness for plant populations. Specifically, I am implementing the univariate L-function Lest in R on a ...
-1
votes
0answers
23 views

Repeated measures with time varying covariates in R

On this page (Model 5, http://www.ats.ucla.edu/stat/spss/faq/repeat_covar.htm), there is a description of how to carry out this type of analysis using SPSS. Does anyone know how to do the same thing ...
0
votes
0answers
15 views

Weight of Evidence(WoE)/Information Value(IV) in R [on hold]

I am building a credit scoring model in R. I have to run logistic regression. But my number of variables is too high, about 3000. I have both continuous and factor variables. And number of observation ...
1
vote
1answer
50 views

Negative Binomial Distribution R

This question was given in class and I was wondering how to do this in R: "Sixty percent of a large lot of old spark plugs are still usable, and they can be individually tested to determine this. Let ...
1
vote
1answer
27 views

How do I contrast code for a factor where one level is the application of both of two others?

I have a factor 'Music' that has four levels: none, piano, guitar, and mixed. Subjects gave a response hearing no music, piano only, guitar only, or piano and guitar, so I want to create an lmer model ...
1
vote
0answers
24 views

CBC analysis using choicemodelr - interpretation of the output attribute values

I finished a choice-based conjoint (CBC) survey. Now i am evaluating my results with the R-Package "ChoiceModelR". With this i get Beta Values, with which i can, for example, compute attribute ...
0
votes
1answer
19 views

Calculating sample size of a mixed ANOVA in R (2 between, 1 within variable)?

I'm searching for a built-in function in R for calculating the required sample size (given certain power, alpha,..) of a mixed ANOVA (2 between, 1 within variable, 2x2x2 design). Does this function ...
0
votes
0answers
7 views

density estimate for continuous support with continuous frequency

I have data with continuous frequency and a continuous support which I'd like to analyze and plot using a kernel density estimate in R. I can create the basic plot in JMP fairly easily using the ...
0
votes
0answers
16 views

Machine Learning Predictors Evaluation Using R

I've bee using R for predicitve analytics and here is issue: I'm trying to predict the species (categorical variables E1, E2, E3 and E4) of an animal using as predictors a set of nominal (NO1, NO2, ...
0
votes
0answers
36 views

How to Calculate π In R [on hold]

This GLM From My Data How To Calculate π With R. I Need R Code.
2
votes
1answer
25 views

Interaction effect of 2x2 ANOVA in meta-analysis

I want to meta-analyze the interaction effect of a 2x2 ANOVA. (I am not talking about an interaction in the meta-regression, as in this question but about an interaction as the focal effect that ...