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

Comparing Height of Web Page against Scroll %

I have a collection of 108 data points in the following format: page height | % of users who scroll 25% of page | 50% | 75% | 100% (full page) I'm trying to find ...
1
vote
0answers
7 views

Reporting the Actual Formula/Equation of an LME model (with factors) used in R?

I have a dataset that has measurements of resource consumption in buildings for a number of years. I am interested in the differences in resource consumption of buildings in my study area between ...
0
votes
0answers
3 views

Can adding uniform sampling weights change p-values?

I am doing an analysis of Average Marginal Component Effects (AMCEs) of a conjoint experiment in R. The package I use, cjoint 2.0 (see amce function), allows to add sampling weights (I want to compare ...
0
votes
0answers
11 views

R variable lengths differ when using predict function to produce graphs

I'm trying to use the predict function, I've successfully used it once but since then it hasn't worked again and I can't figure out why. My aim is to produce a graph with a line through it showing ...
0
votes
0answers
9 views

Displaying data characteristics after multiple imputation

I have original data which I run a few commands on to get a feel for the data. For example, I have men and women, and in each group, I have the percent in each cancer type (eg brain, lung). In the ...
2
votes
2answers
24 views

Understanding the direction & strength of a correlation, & causal status, from a chi-squared test

I am analyzing Stack Overflow Posts. So I have a database with 1000000 questions, their current score (upvote or downvote) and a flag, that there is a source code part in the question (or not). So I ...
0
votes
0answers
18 views

Hierarchical cluster analysis with a similarity matrix

I am trying to analyse the results from a card sorting study i did, but all i have is raw data. I have the similarity matrix for 53 cards, but I am trying to figure out how to do a hierarchical ...
0
votes
0answers
9 views

Separation problem in GLM

So I think I have a separation problem in my logistic regression model. The response variable (that only takes 0 or 1 values) takes 99.2% of its cases as 0 and only 0.8% as 1. This is the ROC curve ...
1
vote
1answer
47 views

Why is my density plot just a line on the bottom?

Basically, I'm just trying to plot a curve over my histogram for the weight of a few students. lines(density(weight), lwd = 2, col = "red") However, what I get ...
1
vote
1answer
11 views

Model matrix for linear model with multiple contrasts

I don't fully understand the concept of a model.matrix. Assume I have the following experimental design: ...
0
votes
0answers
11 views

aggregate all data by Date and ID

I have a dataset with 20 different columns and i want to aggregate all of the columns by the first two columns (Date and ID). Is there a way to say aggregate all instead of typing the names of the ...
0
votes
0answers
12 views

Understanding my serial mediation from R and creating a serial mediation model

I am having trouble understanding my serial mediation results from R. I think that my results are significant, but I'm not sure how to create a model using my results. Can R create the model on its ...
1
vote
0answers
15 views

PLS with more variables than data points

Does it make sense to run partial least squares (PLS) on a data set that has many more columns (variables) than it has rows (data points)? I am using plsr in R. I ...
-1
votes
1answer
27 views

Gaussian processes ordinal regression in R [on hold]

Is there any ordinal regression using gaussian processes implemented in R? I made a research in the Internet, but I didn't find anything.
0
votes
0answers
11 views

Comparing odds ratios - conditional or unconditional MLE

When comparing log(OR) from two contingency tables using Z-test should I use conditional maximum likelihood estimate of odds ratios (as given by fisher.test in R) or simple unconditional?
1
vote
1answer
21 views

Time-dependent variable in survival analysis using R

I am conducting a retrospective study where I have a cohort of cases who underwent the same surgical procedure. The primary outcome of the study is the recurrence incidence rate during a follow up ...
0
votes
0answers
17 views

Comparing the estimated coefficient in Logit versus Mix Logit, regarding the scale parameter

My question is how can I compare the estimated parameters for a logit model with a mixed logit model? I am using mlogitpackage in R and my code is as follows: ...
0
votes
2answers
45 views

how to calculate R-squared in glm?

I came up with below for my glm analysis but I need to calculate R-squared to cite in the paper? anyone can help me with this please? summary(lrfit) Call: ...
0
votes
1answer
13 views

Multi-class logistic Generalized Additive Models [on hold]

I am looking for a package for three-class logit and probit GAM. I have searched and found out that ZeligGAM in R works for this but it seems that it is only applied to binary dependent variables. In ...
0
votes
0answers
23 views

Quantile of a conditional cumulative bivariate normal distribution and R Implementation

I would like to compute a quantile Z of a conditional cumulative bivariate normal distribution. I have two questions: 1) Do I formulate the problem correctly? 2) How would I compute this quantile Z ...
0
votes
1answer
14 views

recode function [on hold]

Two sections of an introductory statistics class took a quiz. The highest possible regular score was 20. Some students got one point of extra credit from a bonus question. A passing grade is 60% or ...
0
votes
2answers
47 views

Building a regression Tree with R FROM SCRATCH

I am trying to build a basic regression Tree in R FROM SCRATCH (I know of rpart, tree, RandomForest,etc.). But it is just something that I would want to code myself for my culture. In terms of ...
1
vote
0answers
18 views

extremely high Cook's D & dfbetas results from influence.ME

I fit a mixed effects logistic regression with the glmer function from the lme4 package to some data I have. Next, I've been using the influence.ME package to run some diagnostics (e.g. Cook's D and ...
0
votes
0answers
13 views

Appropriate cluster method for 7-point scale data of 58 variables and 635 observations

My research buddy and I are conducting cluster analysis on survey data using a 7-point relevance scale (1=Not relevant, 7=Extremely Relevant). We have 58 variables, arranged in 10 groups of ...
4
votes
1answer
42 views

Is the `weights=` option in lmer() doing what I want?

I want to predict PGA golfer performance. I'm wondering if I am correctly giving more weight to more recent results by using the weights= option in the lmer() ...
0
votes
0answers
10 views

How to calculate the effect size after Welch ANOVA?

I used oneway.test() because Levene's test indicated heterogenity of variance. Unfortunately, I don't know how to calculate the effect size now. Does anybody have ...
2
votes
3answers
67 views

How does the logit link handle binomial (1/0) data?

I have a data set that contains a continuous explanatory variable and a set of responses as binary success and failures. For example, ...
0
votes
2answers
45 views

Incorrectly rejecting a null hypothesis

What is the theoretical chance that we (incorrectly) reject the null hypothesis in the following case? ...
0
votes
0answers
4 views

Simultaneous and Pointwise Confidence Bands for GAMs

I am performing a penalized B-spline regression on a simple time series of count data in R using the mgcv package. When I calculate a pointwise confidence band from the standard error of the fit based ...
2
votes
0answers
64 views

Structuring Many-Factor Data for Linear Regression in R

I have a fairly large dataset of the following form, and I want to run a linear regression returning coefficients for each factor: ...
0
votes
1answer
28 views

Fisher Projection vs Linear Discriminant Analysis [on hold]

Basically, I am confused between Fisher and LDA. Looking for differences between the two. How is the Fischer projection computed in R?
1
vote
0answers
10 views

Comparing adjacency matrices

I have 25 weighted adjacency matrices which can be potentially translate into 25 networks. I want to see how ``similar'' are the resulting networks (in a graph theory sense). Is there a way to do ...
0
votes
0answers
14 views

sapply with function using multiple columns as input [migrated]

I have a data frame with let's say 2 columns and 4 rows (it's bigger... I am just making it simpler) like this: Value: 0.2, 0.3, 0.5, 0.8 R: 1, 0, 1, 0 I m trying to write a sapply line that given ...
0
votes
0answers
5 views

error R in Crossvalidation (fold-3) and RR-BLUP and compare GBLUP [on hold]

Crossvalidation three sets of genomic evaluation methods (fold-3) and two   RR-BLUP and compare GBLUP we run the following command in the program R; 1-Sincerely, with thanks, the other two that I need ...
0
votes
2answers
41 views

Word frequency in a vector [on hold]

I have a vector file with 1000 values. All the values were generated using Random function between 0-1. ...
2
votes
1answer
13 views

Is RMSEA an absolute or relative fit statistics test?

I've been studying Structural Equation Model and I have a doubt about RMSEA. In the book Principles and Practices of Structural Equation Modeling Kline treats RMSEA as an approximate fit index (p. ...
2
votes
2answers
48 views

Grad level books for survivability analysis applied to manufacturing

I am looking for a grad level book on survivability analysis applied to manufacturing such as assembly lines. Preferably in R. I am familiar with measure theory, probability theory and R.
0
votes
0answers
9 views

R stepAIC multiple datasets

I have three datasets of similar(ish) sizes (268, 271 and 262), and a model I am trying to develop for describing a response variable within the data. I'm trying to use the ...
0
votes
0answers
17 views

Choosing k in consensus cluster plus using cophenetic correlation coefficient

I am trying choose best k from the consensus clustering using the Cophenetic Correlation Coefficient (CCC). I tried as follows. The correlation coefficients values are poor, i.e., ...
1
vote
0answers
14 views

Multinomial response with repeated measures

I'm studying how sex influences habitat use. I'm looking for suggestions on how to analyze a repeated measure design with a multinomial response variable. I should note that the number of repeated ...
0
votes
0answers
10 views

Calculating optimal alpha, beta, and gamma for Holt-Winters in R [on hold]

Is there a way to calculate the alpha, beta, and gamma parameters in R for Holt-Winters? I tried using the one provided from the HoltWinters formula but it didn't give an accurate answer for ...
0
votes
0answers
14 views

How to identify a SEM with formative dependent variable (with R's lavaan package)?

I have a formative construct in a structural equation model (SEM) which I would like to estimate with the function sem in the ...
0
votes
0answers
20 views

“R” computing derivative of multivariate spline

I am trying to compute the derivative of a multivariate spline, in fact bi-variate I use a b-spline univariate to create a basis, for the first x1 and second variable x2, then I use the tensor product ...
0
votes
0answers
20 views

Computing hazard ratio between groups adjusting for other confounding variables

I have groups formed based on BMI; consider the standard Underweight, Normal, Overweight, etc. groupings for BMI as you might see for classification. I'd like to form a hazard ratio for comparing any ...
2
votes
1answer
39 views

logistic regression with an imbalanced data set, picking threshold cut point

This question relates to whether it is a good starting point for a cut point in binary classification with logistic regression to the use the mean of the binary response variable as the initial cut ...
0
votes
2answers
33 views

segmentation of univariate irregular time series

this is my first post. I have an irregular time series that exhibits large shifts in both mean and in the direction of the trend. It looks something like this (though this is far cleaner than ...
0
votes
1answer
13 views

Making a mob-like decision tree with pre-specified splits and models for leaves

I would like to make a special kind of hybrid tree model in R, similar to the mob models in the party and ...
0
votes
0answers
14 views

how to test if 5 data are homogeneous or not significantlly different

I am currently analysis data of radionuclide content in soil profiles. I have different profiles and data every five cm depth. Each profile contains 5 values of a certain radionuclide. I can represent ...
0
votes
0answers
24 views

Spatio temporal correlation of point data

I am working on a correlation analysis of two inter-relative phenomena, water leaks and water borne disease. Both are geo-references in lat/lon and each event is a date (of occurrence). I want to ...
0
votes
0answers
20 views

Fit dispersal and migration movement in R using nls.Find AIC and Akaike weight for migration and dispersal using R [on hold]

I am trying to fit dispersal and migration movement in r using formula by Bunnefeld et al (A model driven approach to quantify migration patterns, individual, regional and yearly differences) but ...