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

-1
votes
0answers
5 views

Hypothesis testing using R

...
0
votes
0answers
13 views

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

A matrix Aexample is: ...
0
votes
0answers
10 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
12 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
4 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
13 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 ...
4
votes
2answers
58 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
18 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?

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
20 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
8 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
33 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
32 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
21 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
32 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
27 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
0answers
10 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, but I don't understand where to put my data into the code: ...
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
14 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
22 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
14 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
15 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 ...
1
vote
0answers
13 views

Checking the proportional odds assumption holds in an ordinal logistic regression using polr function

I have used the ‘polr’ function in the MASS package to run an ordinal logistic regression for an ordinal categorical response variable with 15 continuous explanatory variables. I have used the code ...
1
vote
1answer
30 views

Bootstrap glm and extract pvalue

I am running a glm model using bootstrap, I can extract the coefficient mean and the confidence intervals for all the factors in my model. But how can I get the pvalue from there? Model: ...
-1
votes
0answers
5 views

Using googleVis api in java [migrated]

I have used googleVis api in R for dynamic map.Now i am trying to make a small webapp in which servlet access this api and the result is displayed in jsp.But i am not able to access googleVis api from ...
0
votes
0answers
6 views

Determing goodness of fit at data with few and sometimes heavy change

Currently, I happen to analyze data where I do have a data matrix for two time points each. Each of these matrices is of dimension nxm, where n is the number of samples and m is the number of ...
0
votes
0answers
58 views

Can I use the correlation value to measure the correlation between two variables when observations in each variable have auto-correlation?

I have two variables: urban areas protected areas. My observations are urban areas and protected areas in each year. But these observations are the cumulative ones, so observations in each ...
0
votes
0answers
20 views

Is it correct or not I applied PERMANOVA-test and interpreted results?

I want to associate nutrients with microbiota bacteria composition. My data consist of two tables: nutrient table (row - patients, column - some of nutrients, e.g. protein, calorage); bacterial ...
0
votes
0answers
14 views

How does one do a Post-hoc test for a Poisson glm in R?

My data consists of the following categories: Site - 3 sites - Boulder, Rubble and Cul-de-Sac Season - 4 types - warm1, warm2, cold1 and cold2 Behaviour - 6 behaviours scored - Basking, ...
0
votes
0answers
23 views

Calculate probability of consecutive event from R simulations

he problem is to calculate the PMF of consecutive flips of head (M) in N number of coin flips. Consecutive heads, k=0, 1, 2,...,N, the PMF is P(M=k). I use $sample(0:1,N,rep=T,prob=(0.25,0.75))$ to ...
1
vote
1answer
31 views

Calculate probability of consecutive event from R simulations

The problem is to calculate the PMF of consecutive flips of head (M) in N number of coin flips. Consecutive heads, k=0, 1, 2,...,N, the PMF is P(M=k). I use ...
2
votes
0answers
18 views

Maximum likelihood of multivariate t-distributed variable with scaled covariance

I am trying to estimate the covariance of a iid multivariate t-distributed random variable, where I define the multivariate density as in the Statlect textbok, which is the same as the wikipedia page. ...