-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f47450e
commit 57b0304
Showing
15 changed files
with
830 additions
and
1,775 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ export(nrmlepln) | |
export(nrmlerasch) | ||
export(startalphas) | ||
export(startbetas) | ||
export(simulpln) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
simulpln <- function(n,nitem,ncat,alphas,betas) { | ||
if(length(betas)!=nitem){stop("Length of betas does not match number of items")} | ||
if(length(alphas)!=nitem*(ncat-1)){stop("Length of alphas does not match nitem*(ncat-1)")} | ||
|
||
## Size may differ from what C wants to return | ||
## But, this is the max size that may be returned | ||
datvec<-rep(0,n*(nitem+1)) | ||
|
||
tem <- .C("Rsimulpln", as.integer(nitem), | ||
as.integer(ncat),as.integer(n), | ||
as.double(alphas),as.double(betas), | ||
datvec=as.double(datvec)) | ||
|
||
##nrec<-length(tem$datvec)/(nitems+1) | ||
##datfr<-matrix(tem$datvec,nrec,nitem+1) | ||
datfr<-matrix(tem$datvec, ncol=nitem+1, byrow=TRUE) | ||
|
||
## trim rows with 0 frequencies | ||
datfr<-datfr[which(datfr[,ncol(datfr)]>0),] | ||
|
||
datfr | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
item1 item2 item3 item4 item5 freq | ||
0 0 0 0 0 4 | ||
0 0 0 0 1 2 | ||
0 0 0 1 0 1 | ||
0 0 0 2 0 2 | ||
0 0 0 2 1 1 | ||
0 0 0 2 2 4 | ||
0 0 1 0 0 1 | ||
0 0 1 0 1 1 | ||
0 0 1 1 0 1 | ||
0 0 1 2 0 1 | ||
0 0 2 0 0 2 | ||
0 0 2 0 1 1 | ||
0 0 2 0 2 1 | ||
0 0 2 1 1 1 | ||
0 0 2 2 1 2 | ||
0 1 0 0 0 2 | ||
0 1 0 1 1 1 | ||
0 1 0 2 0 1 | ||
0 1 0 2 1 2 | ||
0 1 2 0 0 2 | ||
0 1 2 1 1 2 | ||
0 1 2 2 1 1 | ||
0 2 0 1 0 1 | ||
0 2 0 2 2 1 | ||
0 2 1 0 0 2 | ||
0 2 2 0 2 1 | ||
0 2 2 2 2 1 | ||
1 0 0 0 0 1 | ||
1 0 1 2 0 2 | ||
1 0 2 0 2 1 | ||
1 1 0 0 0 1 | ||
1 1 0 2 2 1 | ||
1 1 2 0 2 1 | ||
1 1 2 2 1 1 | ||
1 2 0 2 2 1 | ||
1 2 1 1 2 1 | ||
1 2 1 2 0 1 | ||
1 2 1 2 2 1 | ||
1 2 2 2 2 1 | ||
2 0 0 0 0 1 | ||
2 0 0 0 1 1 | ||
2 0 0 0 2 1 | ||
2 0 0 2 0 2 | ||
2 0 0 2 2 1 | ||
2 0 1 2 2 1 | ||
2 0 2 0 0 1 | ||
2 0 2 0 2 1 | ||
2 1 0 0 0 2 | ||
2 1 0 0 2 1 | ||
2 1 1 1 0 1 | ||
2 1 2 0 0 1 | ||
2 1 2 2 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