Hi, I am using RStudio and I want to simulate for estimating p-value for testing goodness of fit using MCMC method. I problem I am dealing with is fractional factorial design and my response is count data. In this situation to generate my sample using MCMC I have to get markov basis for my matrix. The markov function in the algstat package can do that put I get an error cannot open file markovCode.mat.mar : no such file or directory.

I tried to install 4ti2 and latte-integral softwares which might work with this function, but I still get the same error. Any ideas to get markov bases?

It's hard to tell exactly what's going on from your description alone.

If you look inside the algstat source code, it seems like that object, `markovCode.mat.mar`

is supposed to be downloaded from a web source, so it's possible that's failing somehow:

However, it does look like that site is up:

https://markov-bases.de/

Could you please turn this into a self-contained reprex (short for **repr**oducible **ex**ample)? It will help us help you if we can be sure we're all working with/looking at the same stuff.

```
install.packages("reprex")
```

If you've never heard of a reprex before, you might want to start by reading the tidyverse.org help page. The reprex dos and don'ts are also useful.

There's also a nice FAQ on how to do a minimal reprex for beginners, below:

## What to do if you run into clipboard problems

If you run into problems with access to your clipboard, you can specify an outfile for the reprex, and then copy and paste the contents into the forum.

```
reprex::reprex(input = "fruits_stringdist.R", outfile = "fruits_stringdist.md")
```

For pointers specific to the community site, check out the reprex FAQ.

Thanks for replaying. It is the first time for me to use reprex and this was my example:

```
library(algstat)
#> Warning: package 'algstat' was built under R version 3.5.3
#> Loading required package: mpoly
#> Warning: package 'mpoly' was built under R version 3.5.3
#> whereis not found. Try setting the paths with setM2Path(), setBertiniPath(), setLattePath(), and setMarkovPath().
library(mpoly)
A <- c(rep(1,8),rep(-1,8))
B <- rep(c(1,1,1,1,-1,-1,-1,-1),2)
C <- rep(c(1,1,-1,-1),4)
D <- rep(c(1,-1),8)
E <- c(1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,-1,1,1,-1)
f <- c(1,-1,-1,1,-1,1,1,-1,1,-1,-1,1,-1,1,1,-1)
M <- cbind(A,B,C,D,E,f)
M <- cbind(rep(1,16),M)
M <- as.matrix(M)
M <- matrix(M , byrow = FALSE, ncol=8)
markov(M)
#> Warning in file(con, "r"): cannot open file 'markovCode.mat.mar': No such
#> file or directory
#> Error in file(con, "r"): cannot open the connection
```

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.