Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [r]

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`.

0
votes
0answers
7 views

Poor error control in hierarchical linear models with lagged, within-person-centered independent variables

I'm interested in assessing the performance of a multi-level model (aka hierarchical linear model, aka linear mixed effects model) when examining time-lagged associations. My interest is in making a ...
0
votes
0answers
4 views

how to calculate inverse variance weights for two level regression meta analysis

I want to perform a meta analysis in two levels using linear regression in R (with lm() ). I understand that in the second level I should perform a weighted ...
0
votes
0answers
8 views

Markov Chain and Removal Effect

Based on the article posted at https://analyzecore.com/2017/05/31/marketing-multi-channel-attribution-model-r-part-2-practical-issues/ I'm trying to use within R the Channel Attribution package to ...
1
vote
0answers
12 views

Why does my model predict symmetrical CI for Poisson-distributed data?

Given a set of Poisson-distributed data, I would expect the confidence interval for a glm(..., family="poisson") to be asymmetrical, because of Poisson ...
0
votes
1answer
16 views

polynomial regression in R: how to add hard constraints (go through specified points)? [duplicate]

I'd like to perform polynomial regression on my data (which lies in [0,10]), but I need to ensure that the endpoints of the range are fixed, i.e. that the curve goes through (0,0) and (10,10). So the ...
0
votes
0answers
8 views

Filled contour plot- incorporate error terms? [on hold]

I have filled contour plots in R relating distance and time on the y and x axes and a response variable on the z axis. Is it possible to incorporate error terms into the z variable of these plots? ...
1
vote
1answer
36 views

How to generate increasing (then decreasing) numbers with variance R

I have to generate numbers which increase and decrease, with variance in them. Exactly like the following image. I have tried rnorm but it generates random numbers which do not necessarily increase, ...
0
votes
0answers
25 views

R:Generate tow data sets with an specific correlation and p-value [on hold]

I want to generate tow data set with these attributes : the data sets should be natural numbers and between 1-5 the number of cases should be 384 Spearman or Pearson correlation should be 0.4 P-value ...
0
votes
0answers
33 views

Non-linear regression with vectors as observations

I'm blocking on a computational problem, that is fitting a function $\begin{array}{lrcl} f_{\alpha} : & \mathbb{R}^k & \longrightarrow & \mathbb{R} \end{array}$ to observations $(x_1, ...,...
0
votes
0answers
23 views

Forecast for ARIMA in R doesn't seem to fit

I've been trying to implement some ARIMA modelling of data in R (haven't been using R for long so not sure how well this is done), using the forecast library, but the forecasting part itself doesn't ...
0
votes
0answers
18 views

Estimation of Random effects in lmer(): Defining model correctly

We have analyzed the levels of a protein in 500 samples, analyzing 100 samples in 5 consecutive experiments. 10 of the samples were included in all five experiments, which means there are 460 samples ...
0
votes
1answer
18 views

R - How to get estimates and p-values for random effects in glmer

I have data about around 100,000 protests nested within 40 countries and I want to analyze when the claims of a protest are directed at the state, based on action and country level characteristics, ...
0
votes
0answers
13 views

R package for NHST with likelihood ratio test statistics? [on hold]

I'm wondering if there's a good package for doing NHST in a generalized setting using likelihood ratios, etc. In particular, specifying rejection regions and calculating p-values & power.
1
vote
1answer
23 views

How do I calculate the p-value from an ANOVA from R-Studio?

Don't really know how to interpret this! I am so confused and I tried to follow the examples but I am confused.
0
votes
0answers
14 views

hierarchical bootstrapping and calculation of variance (in a Random-Effects ROC Analysis) in R

I would like to calculate the variance of the AUC of readers (for each reader and averaged results) giving a score(1-5) to ...
0
votes
1answer
13 views

Logarithmic or square root transformation for econometric modeling

I am doing econometric research on firm financial ratios. Using linear panel data modeling, I am going to transform some predictors in order to reduce variance. At this regard, I am uncertain about ...
0
votes
1answer
17 views

Getting equation for lm/ggplot geom smooth with multiple levels [on hold]

I'm trying to get equations for slope intercept for an lm with a three level categorical variable and a continuous covariate. Essentially I have plotted these using ggplot and in the legend I would ...
1
vote
0answers
16 views

Combinef function in R HTS pakage

First I would like to thank R people & package developpers for making available such a collection of great tools. My question is about forecasts reconciliation, as I find huge differences ...
0
votes
0answers
16 views

Linear Discriminat analysis in R [on hold]

I am trying to implement LDA in R using this article after computing the between-class matrix SB and within-class matrix SW how can I compute the discriminant functions and the decision boundary?
0
votes
1answer
22 views

significant Interaction between a significant discrete variable and non significant continuous variable

In my dataset, I have to test the effect of humidity on the height of plants. However, we have an extra effect which is nitrate on height. Each plant had a nitrate measurement but we had one group in "...
0
votes
0answers
8 views

Perform Mann-Whitney U test after pairwise regression to characterise two groups

I have microarray data for infected and uninfected mice. I would like to calculate the distances in expression values within each group, and then use a Mann-Whitney U test to determine if infected:...
0
votes
0answers
10 views

Interaction between categorical and continuous variable

In my dataset, I have to test the effect of humidity on the height of plants. However, we have an extra effect which is nitrate on height. Each plant had a nitrate measurement but we had one group in "...
1
vote
1answer
18 views

How to test whether the association between two continuous variables varies by a third variable?

If I have two continuous variables, and want to check whether their association varies by a categorical variable (e.g. gender), is there a formal statistical test for this? I know I can create a ...
-2
votes
0answers
19 views

Does anyone know why when I run a multiple regression for multiple variables, standard error, p value and t value are missing? [on hold]

Ive ran a multiple regression many times and for some reason now when I run a regression it is not in the correct format and I am missing p value, t value and std error. Attached is a picture.
3
votes
0answers
24 views

Dealing with autocorrelation using Generalized Least Squares

I have a time series data set where the auto correlation of the residuals follow an exponential decay. I was wondering how I should deal with this? I would like to fit a linear model and have tried ...
1
vote
2answers
38 views

Is it mandatory to subset your data to validate a model?

I'm having a hard time getting on the same page as my supervisor when it comes to validating my model. I have analyzed the residues against the fitted values and I used this as an argument to discuss ...
0
votes
1answer
26 views

Comparing two discrete independent variables

I would like to perform something like two-sample Wilcoxon tests/T-test (paired = FALSE) to compare two method's expected scores. Here is the table of counts: ...
2
votes
1answer
13 views

How to get model in knn()?

Given I have classified my inputs using R's built-in knn(): ...
0
votes
0answers
24 views

Underdispersed count data with Quasi Poisson GLM [duplicate]

While learning about generalized linear models, I ran into some issues with underdispered data when trying to predict the number of bedrooms in the King's County data set (available here: https://www....
-1
votes
0answers
15 views

I have this as an assignment question and can not figure it out, need some help please [on hold]

a)The mean weight of King Penguins found in an Antarctic colony last year was 15.4 kg. In a sample of 35 penguins same time this year in the same colony, the mean penguin weight is 14.6 kg. Assume the ...
1
vote
1answer
35 views

Best model to predict if the client will buy our product or not

I would like to find a good model to predict which client will buy my product in 2018. I would like to have opinions on which method can fit my data to predict which client will the product A in 2018. ...
0
votes
0answers
9 views

Write function ecdf [on hold]

My question is about ECDF Write a function ecdf that calculates the empirical cdf of a given numeric vector at the point t. The default value for t should be 0. You can assume that t is also a ...
0
votes
0answers
11 views

How to put values into different columns in Excel from R [on hold]

I have the following R coding in which I want every single value of the "a", "b", "x" and "y" to be recorded in Excel in different columns. ...
1
vote
1answer
14 views

Test in R whether coefficient estimates of categorical variables are different in linear regression

How do I check in R whether coefficients of different levels of categorical variables are statistically the same. The model that I have is: ...
1
vote
0answers
22 views

Predictive models to predict sales with r

I would like to find a good model to predict which client will buy my product in 2018. I would like to have opinions on which method can fit my data to predict which client will the product A in 2018. ...
-2
votes
0answers
16 views

Need help figuring out the R script for this question [on hold]

a) The 95% Confidence Interval for the unknown population mean is calculated using 64 samples and presented as (2.73, 6.63). Precisely interpret this statement. b) Determine the sample mean. c) ...
0
votes
0answers
7 views

How are bayesian networks created from an attribute matrix and target vector?

I'm very familiar with correlation networks but I can't seem to grasp my head around how Bayesian Networks are constructed. How are the "edges" determined? How is the structure determined? I was ...
0
votes
1answer
30 views

R: What is the distance function equivalent for this formula?

Hi I'm using an R package that calculates distance with this formula here, as.dist(1 - cor(df, use = "pa")) However I cannot seem to find an equivalent dist ...
1
vote
1answer
46 views

LME residual plot returns a huge linear block of residual points

The publicly available data I used https://content.sph.harvard.edu/fitzmaur/ala2e/cd4.txt I addressed the unbalanced followup visits by transforming the visit time to the nearest multiple of 8 then ...
-1
votes
0answers
4 views

test of hsiao for panel data test of homogeneity of Fisher [on hold]

how can I do Hsioa test in R or the 3 Hsioa Fisher homogeneity tests pFtest(fixed,random) give me the first test of Hsioa
0
votes
0answers
21 views

predict continuous variable over time for each row

I have many items with a start date, which produce continuous outputs over time for a few months after the start date. These outputs often follow a decay function but not always. So it is a bit like a ...
0
votes
0answers
42 views

Unusual distribution after 10000 iterations of multinomial experiment

I have a ground truth list (gt) which has x observations (time series), each observation can be 1 out of 3 possible classes (b,w,n). I have a classifier C that outputs x observations and I compute the ...
0
votes
0answers
41 views

Can someone help me to interpret these autocorrelation plots?

I've got these two acf plots that were produced in R. The first plot is the acf of a differenced time series (in this case tweets from twitter). The second plot is the acf of the remainder component ...
0
votes
0answers
20 views

regression for categorical variable with multi level [on hold]

I have a problem in R, i am given the instructions as follow: i have to compare a score at follow-up which is a continuous variable (measured in points) for two treatments, A and B (categorical ...
0
votes
2answers
54 views

Overall effect of time in mixed model before looking at individual time points

I have a mixed model using factor(time) as fixed effect and subject as random effect. So the format is like this: ...
0
votes
0answers
11 views

R - Find the closets value in a column list in a data frame [on hold]

I have a long column of numbers, which indicates days for specific ID numbers, so for the first ID number it would maybe look like this [0,23,73,170,....], and I basically want to find the index of ...
2
votes
1answer
48 views

Explaining tourist numbers over time to historic sites, based on a set of predictors

I've been struggling for some time trying to figure out the most appropriate way to analyse some data. My task is to (hopefully) explain what may be driving the flow of visitors/tourists to two ...
1
vote
0answers
23 views

Likelihood-Based Confidence Intervals for ratio of risk ratios

Ratio of Risk Ratio (RRR), along with Relative Excess Risk Due to Interaction (RERI), has been used to quantify the joint effects of 2 exposures in epidemiology. Quoting Joshua N. Pritikin CIs ...
0
votes
0answers
25 views

Clogit maximum likelihood [on hold]

How do I get the maximum likelihood value of a fitted clogit model in R? I would like to perform likelihood ratio tests between different model variations. EDIT: Some clarification: I meant the ...
2
votes
0answers
47 views
+50

MANOVA with variables from different datasets

I conducted several experiments where I have one underlying independent variable (tree species, IV). Each of these experiments gave me one dependent variable (DV), like bark pH, rugosity or the water-...