Displaying 5 results from an estimated 5 matches for "ntheta".
Did you mean:
theta
2012 Jan 05
2
Bayesian estimate of prevalence with an imperfect test
...e is to fill in my values for T, n, low/high
se/sp and the alpha beta for the distributions)
prevalence.bayes<-function(theta,T,n,lowse=0.5,highse=1.0,
sea=1,seb=1,lowsp=0.5,highsp=1.0,spa=1,spb=1,ngrid=20,coverage=0.95) {
ibeta<-function(x,a,b) {
pbeta(x,a,b)*beta(a,b)
}
ntheta<-length(theta)
bin.width<-(theta[ntheta]-theta[1])/(ntheta-1)
theta<-theta[1]+bin.width*(0:(ntheta-1))
integrand<-array(0,c(ntheta,ngrid,ngrid))
h1<-(highse-lowse)/ngrid
h2<-(highsp-lowsp)/ngrid
for (i in 1:ngrid) {
se<-lowse+h1*(i-0.5)
pse<-(1/...
2005 Mar 16
1
Code to replace nested for loops
...# 'theta.vec' is a vector holding 31 possible levels of theta
# ranging from -3 to +3 in intervals of .2.
theta.vec <- seq(-3,3,.2)
theta <- sample(rep(theta.vec,5),100)
x.mat <- (cbind(x1,x2,x3,theta))
rm(x1,x2,x3,theta)
nc <- ncol(x.mat)
ni <- nc - 1
nr <- nrow(x.mat)
ntheta <- length(theta.vec)
# 'opt.mat' is a matrix which will hold the observed proportions
# correct at each level of theta for each item. Rows have
# dimnames corresponding to the 31 levels of theta and columns
# have dimnames corresponding to the item names.
opt.mat <- matrix(rep(NA,n...
2009 Jun 04
0
Dropping terms from regression w/ poly()
Hello r-help,
I'm fitting a model with lm() and using the orthogonal polynomials
from poly() as my basis:
dat <- read.csv("ConsolidatedData.csv", header=TRUE)
attach(dat)
nrows <- 1925
Rad <- poly(Radius, 2)
ntheta <- 14
Theta <- poly(T.Angle..deg., ntheta)
nbeta <- 4
Beta <- poly(B.Beta..deg., nbeta)
model.1 <- lm( Measurement ~ Block + Rad + Theta + Beta + Rad:Theta +
Rad:Beta + Theta:Beta)
Which works splendidly, and for my data set shows that the odd orders
in Theta and Beta...
2006 Sep 19
0
How to interpret these results from a simple gamma-frailty model
...y(survival); set.seed(10000)
lambda <- 0.01 # Exp. hazard rate
# Beta coefficients for Age,TC,HDLC,SBP,Diab,Smok
beta <- c(0.0483,0.0064,-0.0270,0.0037,0.4284,0.5234)
n <- 1000; Ngrp <- 2; # Nr patients, Nr frailty groups
# Thetas for gamma-frailty
thetaset <- c(1,2,10,100); Ntheta <- length(thetaset);
# Define the simulated population
age <-rnorm(n,48.6,11.7);tc<-rnorm(n,200,30)
hdlc<-rnorm(n,47,6);sbp<-rnorm(n,135,6)
rtmp <- runif(0,1,n=n); diab <- rep(0, n); diab[rtmp < 0.05223] <- 1;
rtmp <- runif(0,1,n=n); smok <- rep(0, n); smok...
2013 Jul 23
0
Coxme Package Error Message Help
...d Dev Variance
ID Intercept 2e-02 4e-04
However, when I include a second variable the following error message
follows.
> mcc.risk_time<-coxme(Surv(faketime,Used)~ kauf_avg + Dummy_Time +
(1|ID)+strata(Strata),data=data)
Error in logfun(as.numeric(testvals[i, ]), varlist, vparm, kfun, ntheta, :
NA/NaN/Inf in foreign function call (arg 2)
I have removed all NA values from kauf_avg and neither Time or Age have NA
values.
The only information I can seem to find relevant to this error message is
the following (I have contacted this person and am waiting to hear back but
I thought I mi...