Learn R Programming

PASWR (version 1.0)

Roacheggs: Oriental Cockroaches

Description

A laboratory is interested in testing a new child friendly pesticide on Blatta orientalis (oriental cockroaches). Scientists apply the new pesticide to 81 randomly selected Blatta orientalis oothecae (eggs). The results from the experiment are stored in the data frame Roacheggs in the variable eggs. A zero in the variable eggs indicates that nothing hatched from the egg while a 1 indicates the birth of a cockroach. Data is used in Example 7.16.

Usage

data(Roacheggs)

Arguments

source

Ugarte, M. D., Militino, A. F., and Arnholt, A. T. (2008) Probability and Statistics with R. Chapman & Hall/CRC.

Examples

Run this code
attach(Roacheggs)
p <- seq(0.1, 0.9, 0.001)
negloglike <- function(p){-(sum(eggs)*log(p) + sum(1-eggs)*log(1-p))}
nlm(negloglike, .2)
detach(Roacheggs)

Run the code above in your browser using DataLab