## Solved – Forecasting with holiday dumthe variables

I have an example of call center data for 2013. There are 261 days of data (excluding weekends). For 2013, I have included a holiday dummy variable (holiday) for the days where there were no stats. For 2014, I have also included a future holiday dummy variable (holidayf). My objective is to assess how accurate … Read more

## Solved – Tau, Tau squared and I squared =0

I've used the confint() function of R package metafor to calculate heterogeneity in random effects models in a meta-analysis. I get sensible values for the various parameters (tau, tau^2, I^2) for most of the calculations I have run, however am getting back 0 values for all three parameters for one particular analysis. I have checked … Read more

## Solved – Cosine angle calculation for the documents – Dissimilarity function not working in tm package in R

I want to find the document similarity. I am using the below R code read 1000 txt articles from directory data/txt corpus <-Corpus(DirSource("data/txt"), readerControl = list(blank.lines.skip=TRUE)); some preprocessing corpus <- tm_map(corpus, removeWords, stopwords("english")) corpus <- tm_map(corpus, stripWhitespace) corpus <- tm_map(corpus, stemDocument, language="english") creating term matrix with TF-IDF weighting terms <-DocumentTermMatrix(corpus,control = list(weighting = function(x) weightTfIdf(x, … Read more

## Solved – Problems plotting GLM data of binomial proportional data

This might be a question for the programmers, but I thought I would ask here first. Im comparing browsing pressure on plants between sites. Ive a value to indicate Browsing Pressure and count data of trees that have been damaged between locations. Ive been using Crawleys R example (page 574) regarding sex ratios and my … Read more

## Solved – Simulating a Gaussian (Ornstein Uhlenbeck) process with an exponentially decaying covariance function

I'm trying to generate many draws (i.e., realizations) of a Gaussian process \$e_i(t)\$, \$1leq t leq T\$ with mean 0 and covariance function \$gamma(s,t)=exp(-|t-s|)\$. Is there an efficient way to do this that wouldn't involve computing the square root of a \$T times T\$ covariance matrix? Alternatively can anyone recommend an R package to do … Read more

## Solved – Repeated measures structural equation modeling

I need to analyse a dataset of clinical rehabilitation data. I am interested in hypothesis-driven relationships between quantified "input" (amount of therapy) and changes in health status. Although the dataset is relatively small (n~70) we have repeated data reflecting temporal changes in both. I am familiar with non-linear mixed effects modelling in R however am … Read more

## Solved – n easy way to combine two glm models in R

I have two logistic regression models in R made with glm(). They both use the same variables, but were made using different subsets of a matrix. Is there an easy way to get an average model which gives the means of the coefficients and then use this with the predict() function? [ sorry if this … Read more

## Solved – Partial least squares regression for categorical factor in R

I adjust the partial least squares regression for one categorical factor (2 levels – be or nottobe) with with the pls package in R. I try to use round() function in the predict values for take the decision if the result are the first or second level in my factor. Does this approach sound correct? … Read more

## Solved – What to Do When a Log-binomial Model’s Convergence Fails

There are times when one might want to estimate a prevalence ratio or relative risk, in preference to an odds ratio, for data with binary outcomes – say, if the outcome in question isn't rare, so the RR ~ OR relationship doesn't hold. I've implemented a model in R to do that, as follows: uni.out … Read more

## Solved – 3:1 matching with MatchIt in R. The number of matched control is not equal to 3 times the number of cases

Hello I'm using the MatchIt package in R I have a total of unmatched 116 treated cases and 462 unmatcehd non-treated case with the command mod_match_logit = matchit(f.build("treatement_yes_or_no", covariates), method = "nearest", distance = "logit", data = df, caliper = 0.05, ratio = 3) I get then a result of 91 matched treated cases with … Read more