Skip to content

Lab 06 #4

@Jigarci3

Description

@Jigarci3

Hello,
I am getting an error when I try to run the predict function to find the probability change for an average state- has anyone else been able to run it?

Here is my code:

data2 <- with( data, 
               data.frame( Democrats=mean(Democrats), 
                           Evangelics=mean(Evangelics), 
                           Catholics = mean(Catholics),
                           Media= mean(Media),
                           Merck= mean(Merck) ))

data2$Adoption_Prop <- predict( log, newdata = data2, type = "response" )

data2$Adoption_Prop



The error i receive is: Error in $<-.data.frame(*tmp*, Adoption_Prop, value = c(1 = 0.35531731324293, : replacement has 49 rows, data has 1

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions