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

7,504 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
145 views

Using R in Java Project

I hope this question is not off topic on CV: I am currently fitting some different models (naive bayes, logistic regression...) in R which I up to now thought of as prototypes for a later Java ...
0
votes
0answers
2k views

How to use Almon model (polynomial distributed lag) in R program

I am testing the influence of intramural R&D expenditure, life expectancy, HDP and tax on the GINI index, but I have a problem because I am trying to make my model better by using the Almon model ...
0
votes
0answers
139 views

MS business intelligence development studio CART analysis

I'm doing some clinical database research and in an effort to lessen the burden on our statistical staff, I started to look for different software solutions to get the analyses I need, and that's ...
0
votes
0answers
1k views

Deciding attributes for decision trees

I'm a complete beginner when it comes to R and decision trees, but I was asked to take a look at this to see if this was a viable solution for my data. So please excuse me if I say completely wrong. ...
0
votes
0answers
1k views

Analysis to use with categorical response and categorical predictor variables

I have data from a randomized survey experiment in which each respondent was assigned to one of 4 groups, one of which can be considered a "control" or "no treatment" group. The key question asked in ...
0
votes
0answers
4k views

Nested random effects in lme

I have a data which is longitudinal. I have same subject reading at 3 different treatment one after the other and I ran the samples in 2 batches: Batch one has subject id 1:7 and the three time point ...
0
votes
0answers
350 views

How can I perform an ANOVA from multiple CSV files with R?

I (or rather, my girlfriend whom I'm trying to convert to free software) am just getting started with R. She wants to do a two-way ANOVA on her data on mussels and the threads they release in self-...
0
votes
0answers
118 views

How can I calculate if there is a statistical difference?

I have a study with the following data and I would like to calculate if there is or isn't any statistically significant difference between the 4 groups: ...
0
votes
0answers
311 views

Linear model when both dependent and independent variables have unpaired replicates

I've got a set of experiments where 3 replicate measurements are done for rat cell lines and for human cell lines under different conditions using various compounds. I am trying to predict the ...
0
votes
1answer
35 views

Are there associated variants in these columns?

I have data that look like this in a 365*804 matrix: ...
0
votes
0answers
292 views

Displaying Log Periodogram

I want to perform spectral analysis and was wondering if this command in R: out=mvspec(data,detrend=TRUE,log="yes") displays the detrended log-periodogram. Also ...
0
votes
0answers
159 views

Frailty model using bootstrap sampling

Let say I have a 'kidney catheter' data set which is built in survival package. Data are about the recurrence times to infection, at the point of insertion of the ...
0
votes
0answers
700 views

Fitting Weibull regression with ancillary shape parameter in R

I am trying to replicate a Weibull model for political leaders' survival in R. The model uses the Weibull distribution with the hazard rate h(t)=lambda*pt^(p-1). ...
0
votes
0answers
164 views

R test a regression with only statistically significant variables

I'm performing a multiple logistic regression with a large amount of columns. I want to set all the variables over a certain p value to have 0 coefficients, then test the model on the test data. ...
0
votes
0answers
226 views

Should we always do interpolation polynomially or fill the gaps with the average value?

I have a series which takes values as 1,2 and 3. It also has some ...
0
votes
1answer
42 views

Correlation between growths variables

I'm performing correlations between growth variables (e.g. debt growth and net income growth) and the correlation is rather strong. Nevertheless, I was wondering why when I perform the same ...
0
votes
0answers
83 views

Numerical integration problem

I thought I would write this to Stack Overflow, but LaTeX Math is not working there. I am trying to program the following equation in R: $\hat{\sigma}^2=1/n\sum_{i=1}^{n}[\int \hat{K}(u)\sum_{i=1}^{...
0
votes
0answers
309 views

Is it possible to estimate non-nested levels in a multilevel model in R?

I have a research data with 3 levels of agregation: level1 is the individual, level2 is house area and level3 is school. This means, the levels are not nested in the usual way (level1 within level2 ...
0
votes
0answers
540 views

Lognormal curve fitting

Ok I am guessing this is a trivial question however having pondered it for a few days the only thing I have become clear on is my lack of statistical prowess. Yesterday I asked a question on fitting ...
0
votes
0answers
121 views

Type of ANCOVA design in R

I have the dataset that contains one continuous measure of plant leafs (PC1 scores of individual leafs), that is dependent variable and three others that I need to use as independant, explanatory. One ...
0
votes
0answers
30 views

the approach for checking whether a process is stable?

I have two scenarios for time series data. 1) I have a uni-variate variable spanning across the time axis, are there any approaches or statistic to check whether this process is stable? 2) I have a ...
0
votes
0answers
503 views

Can RBMs be used for feature selection / reduction?

I have a data set that's ~ 150R X 2000C and was curious if an RBM is appropriate in situation with this type of imbalance. It's a microarray and I'm looking at a 0/1 classification problem. I'd be ...
0
votes
0answers
208 views

Autocorrelation of nonstationary IMA(1,1) process

I knwo that the autocorrelation in MA(1) process varies between -.5 and +.5, if we consider d(t)=c+e(t)−θ⋅e(t−1),then for positive values of Theta, autocorrelation is negative and for negative values ...
0
votes
0answers
161 views

Panel data with two time factors

I've got some data that come from a economic experiment. I'm trying to fit a model using plm() function (plm package). I'm following a very good tutorial (Panel data econometrics in R: The plm package)...
0
votes
0answers
441 views

finding x intercept from a set of values

I have run an ACF on a function in R and it returns: Autocorrelations of series ‘sine.curve’, by lag ...
0
votes
0answers
1k views

Flexible discriminant analysis with discrete predictors in R

I am using the mda package and in particular the fda routine to classify in term of gear a set of 20 trips. I preformed a ...
0
votes
0answers
275 views

Compare independent numeric vectors (means) in R

I am working on R, and have multiple data.frames. They all look like this one: ...
0
votes
0answers
649 views

How do I estimate a factorial design with empty factors?

I'm trying to analyse data from a factorial design, but I don't have all combinations of factor levels, and I have repetition for the combination. As this configuration differs from book's examples I'...
0
votes
0answers
196 views

Problem with classifying new observations with discriminant analysis

I have a data set of 40,000 individuals which I clustered using k-means. I used 30 variables, each ordinal from 1=minimum to ...
0
votes
0answers
174 views

Survey Weighted Regression Without FPC in R

I'm using the svydesign package in R to run survey weighted logit regressions as follows: ...
0
votes
0answers
100 views

R CCH CI Univariable Analysis

Using the survival package in R I am trying to calculate 95% confidence interval (CI) of the proportional hazards model coefficient. Normally this is pretty simple to do with the survival package. <...
0
votes
0answers
3k views

rknn - Error: too many ties in knn

I am trying to run rknn with rknn package but it appears an error I am not able to understand. Here's the code and the error: ...
0
votes
0answers
246 views

Articles that describe formulas of how to calculate confidence intervals for the omega-squared effect size?

I'm looking for articles that describe methods of how to calculate CIs for the omega-squared effect size from an one-way ANOVA. The closest I've come is Finch & French (2011) A Comparison of ...
0
votes
0answers
1k views

ezANOVA package in R: right method for my experimental design?

I have a problem with the ezANOVA package using for rm ANOVA or a problem with my statistic design of the experiment (or both ;-)) My file looks like this, <...
0
votes
0answers
424 views

Nonparametric regression in R

I have a time series that appears slightly nonlinear but it's similar to a sin or cos modified by a constant. 1,0 2,2 3,1 4,0 5,5 is one example and 1,0 2,1 3,2 4,0 5,5 is another. Calculating the ...
0
votes
0answers
406 views

How to do rank prediction using R?

I'd like to do rank prediction (something very similar with regression) based on historical data, is there any package I can use in R ? Here's my problems: I have a historical data of sports games, ...
0
votes
0answers
967 views

Interpretation of strucchange::breakpoints in R

OK. I've just read that a breakpoints object with "NA" means no significant structural breakpoint was found, which is fair enough. But then if you call summary() on that breakpoint object, it will ...
0
votes
0answers
253 views

How can all-positive coefficients be chosen in 2nd order linear regression to minimize the number of coefficients?

(this question addresses an expanded case of How can factor-levels be automatically chosen in R to maximize the number of positive coefficients in a regression model?) I am performing linear ...
0
votes
0answers
1k views

how to use model.avg

I have been asking a number of separate questions as each are unique in themselves but connected to my learning process in running mixed effects models. I apologise if i am becoming a nuisance. ...
0
votes
0answers
118 views

Coding the regresssion model with several binary variables

Say I have 5 binary variables and 2 normal variables. I want to get the probability of success, say one of the variable 1 or 0, 1 for success. How can I do that? I tried ...
0
votes
0answers
215 views

Sequential Proportions Test

I have been trying to find some R code but haven't had any luck so far. I am able to perform a sequential t-test on some data that I was working on previously but now my data has a combination of real ...
0
votes
0answers
509 views

Singularity issues when fitting an ARIMAX model

When I want to apply an ARIMA model like this: arimax(dataMat, order=c(7,0,0), xreg=xreg) it raises an error "singular and could not compute QR decomposition ...
0
votes
0answers
3k views

How can I perform a two-way ANOVA without replication in R?

Here is an example I am trying to copy from a text that I have. No idea how to proceed. ...
0
votes
0answers
83 views

local ordinal regressions

I have found no tool to estimate an "oprobit"-like ordinal model using the local regression (local likelihood) framework. It's not built into R's locfit. What is a good way to proceed? Example: I ...
0
votes
0answers
568 views

Problem with GBM model

Alright, hopefully third time is the charm. I'm basically trying to build a predictive model with R and gbm. For various reasons, I can't explicitly state exactly what I'm doing. Basically I have a ...
0
votes
0answers
95 views

Estimating random slopes for 3 variables in multilevel model

I have a dependent variable, 3 predictors and 1 group variable. I would like to estimate the random slopes for each of the three 3 predictors. is the following notation correct? ...
0
votes
1answer
18 views

Should I Include 'Year' Column in PCA

I want to do dimensionality reduction on a dataset. One of the columns present is the Year and the values are 2000, up to 2015. When doing PCA, do you treat this column as a factor or as numeric?
0
votes
1answer
48 views

How do I transform my data when only some treatments are not normal

I've run a shapiro-wilks test on my data to determine its normality, however the results show that some of the treatments are not normal (P<0.05). Do I transform all of the data, or do I just ...
0
votes
1answer
307 views

Dealing with missing month values in dataset and plotting a time series

So i currently have a dataset in R: ...
0
votes
1answer
395 views

K in Fourier series - How to find value of K to use it in ARIMA?

I am using the forecast library for doing some time series forecasting. I need to forecast number of sold items. I am planning to add holidays as xreg in auto.arima. The holiday will be a 0/1 list, ...