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
vote
0answers
18 views

expected values determined with model parameters estimated from a nlme analysis

I'm kind new into nonlinear mixed model theory and I've seen that you cannot determine expected values of your response variable by simply inserting the estimated parameters into your model equation, ...
0
votes
1answer
40 views

Two-way repeated measures ANOVA with unbalanced data

I have a system / operator repeated measures data set for which I would like to answer the questions: is system 1 quicker than system 2 is operator 1 quicker than operator 2 does the order of using ...
0
votes
1answer
36 views

Conditional or unconditional exact test in R

I have a 2x2 contingency table and i want to calculate if the pair inside is significantly different. i made a matrix like the following named raw_matrix ...
2
votes
1answer
44 views

Post hoc $\chi^2$ test with R

This is a quite simple question but I don't find any good, clear, precise answers: I'm looking for a way to perform post hoc test on a chi$^2$ test. I have 2 variables : var1 : good/fair/poor and ...
0
votes
0answers
4 views

Error while mapping SYMBOLS to ENTREZID [migrated]

I am getting a strange error converting Gene Symbols to Entrez ID. Here is my code: testData = read.delim("IL_CellVar.txt",head=T,row.names = 2) testData[1:5,1:3] ...
1
vote
0answers
13 views

How do I produce a set of predictions based on a new set of data using predict in R? [migrated]

I'm struggling to understand how the predict function works and can be used with out of sample data. For instance the following code... ...
0
votes
0answers
9 views

Simplify calculation of mortgage repayments in R [migrated]

I've just started learning R, but I feel that I'm using it only as a normal procedural language without taking advantage of some built-in functions and data structures. As an example I wrote a ...
0
votes
0answers
18 views

How can I display the formula/expression of a lm result in a plot in R? [migrated]

For example, if I was to plot a trendline in Excel I can choose to include its formula on the chart, it will display something like myY = 0.5 + 0.5 * myX. R has ...
2
votes
0answers
74 views

Mixed effect linear regression model output interpretation

just fitted mixed effects model: Linear mixed model fit by maximum likelihood ['lmerMod'] Formula: price ~ variable + (1 | product) Data: podzbior ...
4
votes
3answers
106 views

Estimating the ratio of cell means in ANOVA under lognormal assumption

I am conducting a two-sample test (1-way ANOVA with 2 treatments), and the goal is to estimate the ratio of cell means assuming that the data are lognormal. A simple approach is to log the response ...
0
votes
1answer
29 views

Multi-class Confusion Matrix to Binary confusion matrix

i know the main concepts of data/text mining but i used them mainly in binary classification problems (just two classes). i am now dealing with a problem with 8 classes and i am atruggling how to ...
0
votes
0answers
26 views

Problem with maximum likelihood estimation in R: NaNs produced

I'm trying to estimate 4 maximum likelihood estimators on a data set containing two variables: x and y. When using the following ...
0
votes
0answers
35 views

Interpreting / understanding intercept and slope values for an interaction using summary output in R

In R, using lme4, I am using a mixed model to test how a response (mode; continuous and normally distributed) is affected by a covariate (species richness (sr); continuous and normally distributed) ...
0
votes
0answers
25 views

Getting unexpected lme results

I am evaluating an experiment in which subjects had to rate quality of audio files. The design of the experiment is repeated-measures. So I'm trying to figure out which factors have an impact on ...
0
votes
2answers
44 views

Interpreting ordinal regression result and calculating individual percentage contributions of independent variables

I ran an ordinal logistic regression in R using the polr function on a survey analysis dataset. The responses of the dependent variable range from Poor to Excellent. The responses to the independent ...
0
votes
2answers
63 views
+100

Library routine for rolling window lag 1 autocorrelation?

I am looking for a library routine that will calculate the lag 1 autocorrelation of a time series with a rolling window; meaning "slide a window of size N points along the time series, calculate the ...
1
vote
1answer
32 views

Mixed model interaction (covariate+factor): How to interpret posthoc table output in R package phia?

In R, using package lme4, I have used the following 2 mixed models to determine I have a signifacnt interaction between a covariate (continous, normally distributed) and a factor (three levels: ...
0
votes
0answers
17 views

Multiple Factor analysis and squared cosines

I am a bit confused on how to proceed using the MFA analysis from FactoMineR in my data set. I am currently working with activity results of 15 bacteria (b1, b2, b3, b4, b5,.., b15), divided into 3 ...
7
votes
2answers
215 views

What to do when CFA fit for multi-item scale is bad?

I am not sure how to proceed with this CFA im doing in lavaan. I have a sample of 172 participants (I know that’s not much for a CFA) and 28 items with 7-point Likert scales that should load on seven ...
1
vote
1answer
53 views

How do I perform this complicated ANOVA type analysis in R?

I have the following type of dataset: | | | variable_r | subject | gender | age_group | Cond_1 | Cond_2 | ...
0
votes
1answer
36 views

Constrained and Weighted Regression

I'd like to modify the answer to this question to allow weighted observations. I think all I need to do is weight the inputs X and Y. X = w * X Y = w * Y the ...
1
vote
0answers
19 views

grofit package for growth curves and prediction?

I am trying to use grofit package for biological growth curves. I would like to see which curves describe best my data and from them predict results I don’t have. I basically have a sample of data ...
0
votes
1answer
47 views

I am confused with ranef function in R

Do the ranef and fixef functions in lmer give the random and fixed effect coefficients? If ...
1
vote
1answer
17 views

choosing one pair randomly from repeated pairs

I have two vectors, in my case all states in the US, and another vector, which indicates the states that it borders. States in vector 1 repeat for each state it borders. For instance, there would be 3 ...
0
votes
1answer
31 views

predict function in glmnet

What kind of object the predict function in glmnet returns ? I can't access the values of predict. ...
0
votes
0answers
4 views

Extracting full set of coefficients for multilevel explanatory factor in clmm

I am having trouble extracting coefficients for all levels of a explanatory response from clmm() in the ordinal package. My problem seems basic, and feel I am missing something obvious, forgive me if ...
2
votes
0answers
13 views

if the suggested power transformation by spread level plot is 1, does the model have constant variance?

I am working on checking for constant variance in linear models and checking by looking at the plot of studentized residuals with fitted values. My data set via the plot looks to have a constant ...
0
votes
0answers
24 views

How can i make a fraud detection dataset (I have the data ready but unordered)

I'm a little confused with the creation of the dataset for a fraud detection predictive model. Here i put a link with a sample of the dataset that I made. (the real dataset have ~950.000 clients). ...
1
vote
1answer
36 views

Meaning of R's coxph output

I am getting below output from coxph function in R. ...
3
votes
1answer
72 views

Specification of crossed random effects model in R

I have an experiment with a design in which subjects answer four items that are of four different types based on two factors (lets call the factors letter: "a" X "b" and big: "A" X "a", resulting in ...
2
votes
3answers
53 views

Test model coefficient (regression slope) against some value

In R, when I have a (generalized) linear model (lm, glm, gls, ...
0
votes
0answers
35 views

F test to compare regression coefficients across different groups, using R

Imagine the following type of dataset: I have a dependent variable Y, two independent variables X and Z, and a variable that can separate the dataset in two smaller datasets. I estimated 2 ...
0
votes
1answer
36 views

After trying various optimzers, model simplification running more iterations, when fitting GLMMs, R still produces warning messages

I am trying to fit GLMM's to my data using the glmer function available in R's lme4 package. The data is available at: https://onedrive.live.com/redir?resid=1B727FC7180E87DF%21118 I keep getting ...
0
votes
1answer
28 views

correct use of Negative Binomial with a Geometric distribution in a mixed model (glmmPQL)

I am trying to fit a NB GLMM with a gemoetric distribution. I have come across very little information on this form of regression. And would like some pointers/reasurance. some literature is ...
0
votes
0answers
37 views

Autoregressive distributed lag models ADL(p,q): seeking “how to” preferably in Matlab (Stata/R/Python/C# etc)

Could anyone provide me the details of how to determine the lag order of the distributed lags for an $\text{ADL}(p,q)$ model in Matlab or another statistical package (and very much preferably in ...
0
votes
4answers
98 views

How to form a predictive model in R?

I have two data sets whose structure is like this: DATA SET 1: ...
0
votes
0answers
42 views

Mixed linear models in R, help with nested terms and procedure

This is my first post, so sorry if it not optimally written. I have a paired samples at two time points in two groups, undergoing the same intervention. I want to test the effect of my intervention on ...
1
vote
1answer
33 views

Over represented gender in linear modelling data

I am fitting a model to some sales data and looking to accurately represent male/female behaviour (e.g basket analysis). For example, I know the proportion of females/males in the population buying ...
0
votes
0answers
10 views

Interpreting the relInterIntra {irr} results in R

I am using this for a reliability analysis test for quantitative values between two raters. I got my results using the "relInterIntra {irr}" package in R, but the reported values gave me several ...
0
votes
0answers
14 views

Down-sampling the majority class-How can I assure that all rows are been picked?

My doubt is about Down-sampling. I have an imbalanced data and I have use down-sampling, but I am not sure if all rows has been picked at any fold I have been use 10 folds.
1
vote
0answers
38 views

Specifying a linear mixed model in lmer with replications nested within a fully crossed design

I’m trying to specify a linear mixed model for a somewhat complicated, nested & crossed method comparison study with replicated measurements. The goal is to partition and compare variances. It’s ...
0
votes
0answers
54 views

How to develop a prediction model based on correlation in R?

I have two sets of data, say sales and profit, and I have calculated the correlation between these two data over different months using R. So currently I have ...
0
votes
1answer
54 views

How to determine which variable or combination of the variables are affecting to the predictor variable?

I have one dependent variable name as "win ration" of the deal contested and more than 30 independent variables, all are categorical variable name as role of the customer, geo, region, and 27 ...
3
votes
2answers
228 views

What is the p-value for paired t-test if the two set of data are identical

As title, I have two set of data that are identical and performed paired t-test using R, the p-value for the difference estimated (which is essentially 0) is NaN. I wonder if there can be a ...
2
votes
2answers
90 views

Reproduce linear discriminant analysis projection plot

I'm struggling with projection points in linear discriminant analysis (LDA). Many books on multivariate statistical methods illustrate the idea of the LDA with the figure below. The problem ...
0
votes
1answer
15 views

rms package, getting zero Dxy in validation of cph model

I'm doing Cox proportional hazards analysis using Frank Harrell's rms package (4.2.0), with 3 strata. My model seems reasonably predictive on training data (Dxy=-0.537), but somehow in bootstrap ...
-1
votes
1answer
38 views

Evaluating sum of slopes of a signal [closed]

I am from India, a novice in Research. Can you just tell me whether I can take a graph of an ECG signal as input and find the slope of this continuous signal at every given point in the graph. I ...
1
vote
1answer
45 views

How does one derive the survival function from an accelerated time failure model in R?

I'm currently working with accelerated time failure models. However, when I fit a model using survreg in R, the predict function ...
2
votes
0answers
63 views

Generate boxplots for a combination of categorical variables [migrated]

How would I do the following? In a single plot, I would like to create multiple box plots, each X variable being a combination of the categorical variables shown below. ...
0
votes
1answer
60 views

Number of observations in groups - linear mixed effects model

I would like to fit linear mixed effects model to my dataset, but I was wondering if quantity of observations in groups matter? I have some groups with about 60 observations in each, but there are ...