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

Repeated measurments with R

I read quite a bit of answers on similar questions, but some of them are contradictory. We have several treatments with number of subjects for each one. For each subject we have measurments for ...
0
votes
0answers
4 views

How to do forward stepwise regression using adjusted R^2 in R [on hold]

As I understand, stepwise regression in R uses AIC by default. How can I do forward stepwise regression in R, using "significant improvement in adjusted R squared" as my criterion for adding ...
0
votes
0answers
6 views

XERGM R-package: GOF error with bipartite, temporal ERGM

I was able to estimate the following temporal, bipartite ERGM using the xergm package in R: ...
0
votes
0answers
22 views
0
votes
0answers
8 views

correlations between factors in r- scores or loadings?

I've conducted a factor analysis in r with three factors (function=fa {psych};rotation=promax ; method=GLS). ...
3
votes
0answers
32 views

How to test if “previous state” has influence on “subsequent state” in R

Imagine a situation: We have historical records (20 years) of three mines. Does the presence of silver increases the probability of finding gold in next year? How to test such question? Here is ...
0
votes
0answers
13 views

log-likelihood of multivariate regression

I am struggling with R to calculate log-likelihood of multivariate regression (i.e. more than one response, one or more predictors). I would like to have a function taking object of class "mlm" as an ...
3
votes
0answers
42 views

How are outliers dealt with in R after detected? [on hold]

Once outliers in time series are detected in R how exactly are they dealt with before forecasting? I dont want commands to use i would like the method. Please do not give any answers to do with ...
0
votes
0answers
19 views

How to demonstrate biased estimates of linear regression vs cox proportional hazard survival analysis in R?

I want to perform a really simple simulation of right censored data. Then I want to draw a kaplan meir survival curve and do a cox proportional hazards test. Then I also want to perform a simple ...
0
votes
0answers
16 views

How do you get the principal components of one matrix along the principal directions of another matrix?

Please just don't close this. I really hope someone will be able to give me the answer to this one. I've been trying to work this out for a long time. I have a data matrix, A, on which I have ...
3
votes
1answer
20 views

How to simulate noisy respondent entry of short textual responses? [on hold]

I have a list of company name as following: ...
0
votes
1answer
18 views

Computing Issues with Kriging

I am having some issues with Kriging in R, and I was looking for some idea where I am going wrong. From what I can tell, I done a decent job removing the trend, and I believe my transformed data is ...
0
votes
0answers
6 views

R: how does caret choose default tuning range?

When using R caret to compare multiple models on the same data set, caret is smart enough to ...
0
votes
0answers
15 views

Plotting List of Words with R [on hold]

I am an R beginner in way over his head. I am starting with a list of character vectors. It starts with 25 words. Each year some of these words are pruned from the vectors. I want to plot the list of ...
0
votes
1answer
41 views

k means with binary variables

Is it OK to use kmeans with binary variables? I mean Euclidean distance? I guess the binary variables will be the ones that get the most power to determine the ...
0
votes
0answers
25 views
0
votes
1answer
13 views

assigning column name to a data frame by reading a different file [on hold]

I have created a data frame from a pre given data set which does not have column name.so by default the col names are V1, V2.......V42. Now I have one more file (.txt) which has one column with 41 ...
0
votes
0answers
6 views

adding two transition columns to a dataframe [on hold]

Hello I have a dataframe with 1/0 variable, call it remission I also have another column of patient id's i also have another column of recorded times(not time to achieve remission) just time i want ...
0
votes
0answers
14 views

Interpretation of linear and quadratic interactions

I'm working on building and interpreting multilevel models. In one, I'm predicting binge episodes over time and using a linear time by baseline characteristic interaction as well as a quadratic time ...
2
votes
1answer
42 views

How can a univariate seasonal time series be made normally distrubuted by Box-Cox transformation?

I'm trying to fit a sarima model on the univariate data with 180 points (periodicity=12). I use the auto.arima function in R. After fitting a model to the data, the only problem is the violation of ...
0
votes
0answers
7 views

Error in predict function when training set and test set have different columns [on hold]

I have a dataset which I split into a Test and a Train . On the Train dataset I have done a few preprocessing steps such as Imputing missing values, dummyfying variables, and also added a few extra ...
1
vote
0answers
10 views

Monte-Carlo: R script not returning anything [migrated]

My R script is mcnorm.R <- function(M,N) { library("mvtnorm", lib.loc="~/R/win-library/3.2") R <- as.matrix(read.csv("Data.csv", header=FALSE)) mu <- colMeans(R) ...
1
vote
0answers
14 views

F-Test for Equality of Variances with Weighted Survey Data

I would like to use an F-Test for Equality of Variances on a variable to compare two groups. Normally, this would be done with an sdtest command in Stata or a ...
0
votes
1answer
33 views

Best ways to model 'big data' given limited computing resources

Suppose I have a large data set(10 GB), with a response variable and multiple independent variables. What is the best way to utilize the data to build a model on? If the full data set includes 10 ...
0
votes
0answers
24 views

Standard deviation error bars and kruskal.test in R

I need to test if there is a significant difference between two groups of data, each with three replicates. (Multiple groups) I used the following approach: ...
0
votes
1answer
27 views

Histogram in R from two vectors [on hold]

how can I create a histogram in R from known values and counts? Thing is, I need to change manually h\$counts in my data set, so I have no data for that new histogram with changed values in h\$counts. ...
0
votes
0answers
13 views

Variable selection via mutual information

I am building a SVM model and was wondering whether filtering variables based on mutual information between response variable(binary 0/1 variable)is a good approach? Also, would the condinformation ...
0
votes
1answer
15 views

How to return all a particular column in a data frame

Suppose I have a data frame mysample. When I try to access only the second column using mysample[,2] I get a single element. How do I return the second column of the data frame?
-1
votes
0answers
17 views

How do you do a log-linear analysis in r? [on hold]

I can't seem to find anything on log-linear analysis. Does anybody know how to do them in r? I have two variables: one a dependant one (yes or no recoded as 1 or 0) and an independant one with 5 ...
0
votes
0answers
9 views

JAGS dmstate markov specification

Does any one have experience in running multi state models in jags? I am trying to run a msm on my dataframe with activity being 1/0 time from diag being times observation of the activity and patient ...
0
votes
1answer
36 views

How to randomize order by sets in r? [on hold]

I need to randomize a list of words by sets. I have a list of 5 pairs of words and in each pair there are two words: one word in position 1 (1w1) and another word in position 2 (1w2). These pairs are ...
1
vote
1answer
39 views

Method for fitting censored data in R

I have 320 data points - each has a redshift and a turnover-frequency, and I want to fit a correlation between them (a linear fit). However, 120 of the turnover-frequency values are upper limits. As ...
0
votes
0answers
16 views

Any R packages for mixed logit or probit? [on hold]

I have choice data sets and choice is decided within pairs (Choice A or B). If I have 100 pairs and each pair has each decision values but each pair has different situation, I would need to use mixed ...
0
votes
0answers
9 views

remove factor level if factor level has outlier in any of other columns in R dataframe

Hello I have a dataframe with one column a factor of patient id's, other columns of continous variables. I want to remove patients from the dataframe if they have an outlier observation in any of the ...
3
votes
1answer
19 views

What is a paired observation or paired variable?

The question kind of asks itself, can anyone explain what a paired observation or paired variable is in basic terms? My data consist of the number of words learnt in a week for 19 different ...
0
votes
0answers
22 views

What type of statistical analysis would be best to use?

I'm awful at statistics so could really use some help regarding statistical analysis and which approach to use. Here is what I know - I need to determine, based on stats I have been given, whether ...
1
vote
0answers
32 views

Logarithm of incomplete Beta function for large alpha,beta [on hold]

R's function pbeta is supposed to calculate the incomplete regularized Beta function. If the flag log=TRUE is passed as an ...
0
votes
0answers
10 views

Using predictive algorithms for descriptive purposes? Correct? Any resources?

Newbie here. I've been learning lots of predictive modeling with R/python using the well-known algorithms: decision trees, random forests, SVM, logistic/linear regression, k-Means, k-NN. But I'm new ...
0
votes
0answers
11 views

How to fit an logistical autoregression in R?

I modeled the relationship of $X$ and $Y$ by the logistic function. The residual plot displays autocorrelation which I'd like to rid. I want to try adding trend component to $X$, thus the model ...
0
votes
2answers
53 views

How to interpret this interaction in R?

How would you interpret this interaction? The structure of the data is all integer variables. Inc.fix= income, age.fix=age, profit99= profit ...
0
votes
0answers
14 views

R: plotting decision tree with leaves text labels [on hold]

I use a package mvpart (MS -species in sites, TTE - parametres of environment) ...
0
votes
0answers
14 views

Regression with caret and uknown levels [on hold]

I'm trying to perform a cross-validated linear regression with caret. Unfortunately it always fails as some values for levels are not to common and therefore the prediction fails with the error ...
-1
votes
0answers
13 views

Need better guesses for nls [on hold]

I got need better guesses for this nls function, I was wondering if anyone could help me find better guesses. Sorry I don't know how to post code correctly, everything below here is code. ...
-1
votes
0answers
27 views

Structural Equation Modeling in R throws an error: system is computationally singular [on hold]

I am using Structural Equation Modeling in R. Below is the model that I have specified. The error that I am getting while training the model is: system is computationally singular: reciprocal ...
2
votes
1answer
53 views
+50

Putting less weight on certain data points in a series for forecasting

I have a data set that contains outliers (big orders) i need to forecast this series taking the outliers into consideration. I already know what the top 11 big orders are so i dont need to detect them ...
1
vote
0answers
9 views

Is E-Divisive with Medians (the Twitter BreakoutDetection algo) robust and efficient?

There are quite a few algorithms to detect changepoints, outliers, mean shifts, trend shifts etc. out there. Recently I've stumbled upon BreakoutDetection and while it's new and shiny I'd like to know ...
0
votes
1answer
29 views

Adding observations by aggregating existing data

Question I'm aware that generating features from existing data can be a valid method for adding new features for a regression/ML algorithm*, but can you add observations generated from existing data? ...
0
votes
1answer
19 views

What do the the lsmeans (from lsmeans package in r) represent when calculated over a poisson linear mixed-effect model (fit with glmer)

I am analyzing the eye-tracking data from a designed experiment. A simplified version of my data looks like this (You can get the dput() data here), ...