SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
does anyone know how to type this in R What is the predicted wage growth if unemployment is
2.50 and the economy is not in recession? (be sure to use single quotes when setting the value for
economy) "
that the code I used : model7 <- lm(wage_growth ~ unemployment + economy +
unemployment:economy + I(unemployment^2) + I(unemployment^2):economy, data=economic)
summary(model7)
newdata <- data.frame(unemployment = 2.50 , economy='not in recession')
print("prediction interval") prediction_pred_int <- predict(model7, newdata, interval="predict",
level=0.90) round(prediction_pred_int,4)
print("confidence interval") prediction_conf_int <- predict(model7, newdata, interval="confidence",
level=0.90) round(prediction_conf_int,4)
I think the line that is bold is the problem but I don't know how to fix it.
that the error msg I keep getting :
Error in model.frame.default(Terms, newdata, na.action = na.action, xlev = object$xlevels): factor
economy has new level not in recession Traceback: 1. predict(model7, newdata, interval =
"predict", level = 0.9) 2. predict.lm(model7, newdata, interval = "predict", level = 0.9) 3.
model.frame(Terms, newdata, na.action = na.action, xlev = object$xlevels) 4.
model.frame.default(Terms, newdata, na.action = na.action, xlev = object$xlevels) 5.
stop(sprintf(ngettext(length(m), "factor %s has new level %s", . "factor %s has new levels %s"),
nm, paste(nxl[m], collapse = ", ")), . domain = NA)
bs in the example used in class the professor used this code: newdata <-
data.frame(inflation=2.1, economy='recession')

Más contenido relacionado

Más de adamsapparelsformen

Doctors Diaries is a 1990s documentary following a group of.pdf
Doctors Diaries is a 1990s documentary following a group of.pdfDoctors Diaries is a 1990s documentary following a group of.pdf
Doctors Diaries is a 1990s documentary following a group of.pdfadamsapparelsformen
 
Dont respond to this questionGive only the references Bib.pdf
Dont respond to this questionGive only the references Bib.pdfDont respond to this questionGive only the references Bib.pdf
Dont respond to this questionGive only the references Bib.pdfadamsapparelsformen
 
dogh dogcpp maincpp For the code above How many MyCo Cop.pdf
dogh dogcpp maincpp For the code above How many MyCo Cop.pdfdogh dogcpp maincpp For the code above How many MyCo Cop.pdf
dogh dogcpp maincpp For the code above How many MyCo Cop.pdfadamsapparelsformen
 
Donald Lyles 52year old male was admitted yesterday eveni.pdf
Donald Lyles 52year old male was admitted yesterday eveni.pdfDonald Lyles 52year old male was admitted yesterday eveni.pdf
Donald Lyles 52year old male was admitted yesterday eveni.pdfadamsapparelsformen
 
Domes and basins In some folds Inliers and outliersFigur.pdf
Domes and basins  In some folds Inliers and outliersFigur.pdfDomes and basins  In some folds Inliers and outliersFigur.pdf
Domes and basins In some folds Inliers and outliersFigur.pdfadamsapparelsformen
 
Dolce is an Italian company selling highend turnkey kitchen.pdf
Dolce is an Italian company selling highend turnkey kitchen.pdfDolce is an Italian company selling highend turnkey kitchen.pdf
Dolce is an Italian company selling highend turnkey kitchen.pdfadamsapparelsformen
 
Do This Consider the partial class declarations below A co.pdf
Do This Consider the partial class declarations below A co.pdfDo This Consider the partial class declarations below A co.pdf
Do This Consider the partial class declarations below A co.pdfadamsapparelsformen
 
Doede Corporation uses activitybased costing to compute pro.pdf
Doede Corporation uses activitybased costing to compute pro.pdfDoede Corporation uses activitybased costing to compute pro.pdf
Doede Corporation uses activitybased costing to compute pro.pdfadamsapparelsformen
 
Does anyone have a photo of the completed moon map I need t.pdf
Does anyone have a photo of the completed moon map I need t.pdfDoes anyone have a photo of the completed moon map I need t.pdf
Does anyone have a photo of the completed moon map I need t.pdfadamsapparelsformen
 
Document your result for H influenzae below 1 What is the.pdf
Document your result for H influenzae below 1 What is the.pdfDocument your result for H influenzae below 1 What is the.pdf
Document your result for H influenzae below 1 What is the.pdfadamsapparelsformen
 
Doal gaz doru bir ekilde tanmlayan ifadeyi sein Fracking.pdf
Doal gaz doru bir ekilde tanmlayan ifadeyi sein  Fracking.pdfDoal gaz doru bir ekilde tanmlayan ifadeyi sein  Fracking.pdf
Doal gaz doru bir ekilde tanmlayan ifadeyi sein Fracking.pdfadamsapparelsformen
 
Do it in Java Problem4 Natural Language Processing Writ.pdf
Do it in Java Problem4 Natural Language Processing Writ.pdfDo it in Java Problem4 Natural Language Processing Writ.pdf
Do it in Java Problem4 Natural Language Processing Writ.pdfadamsapparelsformen
 
Diyelim ki mevcut d politikann aksine ABD ve Meksika farkl .pdf
Diyelim ki mevcut d politikann aksine ABD ve Meksika farkl .pdfDiyelim ki mevcut d politikann aksine ABD ve Meksika farkl .pdf
Diyelim ki mevcut d politikann aksine ABD ve Meksika farkl .pdfadamsapparelsformen
 
Do it in Java Please ExamPrep4_Spring2023 Source Packages lo.pdf
Do it in Java Please ExamPrep4_Spring2023 Source Packages lo.pdfDo it in Java Please ExamPrep4_Spring2023 Source Packages lo.pdf
Do it in Java Please ExamPrep4_Spring2023 Source Packages lo.pdfadamsapparelsformen
 
DNA replikasyonundan geen bakterileri moleklleri izlemeni.pdf
DNA replikasyonundan geen bakterileri moleklleri izlemeni.pdfDNA replikasyonundan geen bakterileri moleklleri izlemeni.pdf
DNA replikasyonundan geen bakterileri moleklleri izlemeni.pdfadamsapparelsformen
 
DNA exits mostly as a double stranded molecule Because of .pdf
DNA exits mostly as a double stranded molecule Because of .pdfDNA exits mostly as a double stranded molecule Because of .pdf
DNA exits mostly as a double stranded molecule Because of .pdfadamsapparelsformen
 
Dk bir gerileme R2 u anlama gelir A sol taraftaki d.pdf
Dk bir gerileme  R2  u anlama gelir   A  sol taraftaki d.pdfDk bir gerileme  R2  u anlama gelir   A  sol taraftaki d.pdf
Dk bir gerileme R2 u anlama gelir A sol taraftaki d.pdfadamsapparelsformen
 
Divisional Income Statements and Retum on fnvestment Analysi.pdf
Divisional Income Statements and Retum on fnvestment Analysi.pdfDivisional Income Statements and Retum on fnvestment Analysi.pdf
Divisional Income Statements and Retum on fnvestment Analysi.pdfadamsapparelsformen
 
discussing Monopolies and Externalities Positive and Negati.pdf
discussing Monopolies and Externalities Positive and Negati.pdfdiscussing Monopolies and Externalities Positive and Negati.pdf
discussing Monopolies and Externalities Positive and Negati.pdfadamsapparelsformen
 
Distinguish time clauses from conditions and name the types .pdf
Distinguish time clauses from conditions and name the types .pdfDistinguish time clauses from conditions and name the types .pdf
Distinguish time clauses from conditions and name the types .pdfadamsapparelsformen
 

Más de adamsapparelsformen (20)

Doctors Diaries is a 1990s documentary following a group of.pdf
Doctors Diaries is a 1990s documentary following a group of.pdfDoctors Diaries is a 1990s documentary following a group of.pdf
Doctors Diaries is a 1990s documentary following a group of.pdf
 
Dont respond to this questionGive only the references Bib.pdf
Dont respond to this questionGive only the references Bib.pdfDont respond to this questionGive only the references Bib.pdf
Dont respond to this questionGive only the references Bib.pdf
 
dogh dogcpp maincpp For the code above How many MyCo Cop.pdf
dogh dogcpp maincpp For the code above How many MyCo Cop.pdfdogh dogcpp maincpp For the code above How many MyCo Cop.pdf
dogh dogcpp maincpp For the code above How many MyCo Cop.pdf
 
Donald Lyles 52year old male was admitted yesterday eveni.pdf
Donald Lyles 52year old male was admitted yesterday eveni.pdfDonald Lyles 52year old male was admitted yesterday eveni.pdf
Donald Lyles 52year old male was admitted yesterday eveni.pdf
 
Domes and basins In some folds Inliers and outliersFigur.pdf
Domes and basins  In some folds Inliers and outliersFigur.pdfDomes and basins  In some folds Inliers and outliersFigur.pdf
Domes and basins In some folds Inliers and outliersFigur.pdf
 
Dolce is an Italian company selling highend turnkey kitchen.pdf
Dolce is an Italian company selling highend turnkey kitchen.pdfDolce is an Italian company selling highend turnkey kitchen.pdf
Dolce is an Italian company selling highend turnkey kitchen.pdf
 
Do This Consider the partial class declarations below A co.pdf
Do This Consider the partial class declarations below A co.pdfDo This Consider the partial class declarations below A co.pdf
Do This Consider the partial class declarations below A co.pdf
 
Doede Corporation uses activitybased costing to compute pro.pdf
Doede Corporation uses activitybased costing to compute pro.pdfDoede Corporation uses activitybased costing to compute pro.pdf
Doede Corporation uses activitybased costing to compute pro.pdf
 
Does anyone have a photo of the completed moon map I need t.pdf
Does anyone have a photo of the completed moon map I need t.pdfDoes anyone have a photo of the completed moon map I need t.pdf
Does anyone have a photo of the completed moon map I need t.pdf
 
Document your result for H influenzae below 1 What is the.pdf
Document your result for H influenzae below 1 What is the.pdfDocument your result for H influenzae below 1 What is the.pdf
Document your result for H influenzae below 1 What is the.pdf
 
Doal gaz doru bir ekilde tanmlayan ifadeyi sein Fracking.pdf
Doal gaz doru bir ekilde tanmlayan ifadeyi sein  Fracking.pdfDoal gaz doru bir ekilde tanmlayan ifadeyi sein  Fracking.pdf
Doal gaz doru bir ekilde tanmlayan ifadeyi sein Fracking.pdf
 
Do it in Java Problem4 Natural Language Processing Writ.pdf
Do it in Java Problem4 Natural Language Processing Writ.pdfDo it in Java Problem4 Natural Language Processing Writ.pdf
Do it in Java Problem4 Natural Language Processing Writ.pdf
 
Diyelim ki mevcut d politikann aksine ABD ve Meksika farkl .pdf
Diyelim ki mevcut d politikann aksine ABD ve Meksika farkl .pdfDiyelim ki mevcut d politikann aksine ABD ve Meksika farkl .pdf
Diyelim ki mevcut d politikann aksine ABD ve Meksika farkl .pdf
 
Do it in Java Please ExamPrep4_Spring2023 Source Packages lo.pdf
Do it in Java Please ExamPrep4_Spring2023 Source Packages lo.pdfDo it in Java Please ExamPrep4_Spring2023 Source Packages lo.pdf
Do it in Java Please ExamPrep4_Spring2023 Source Packages lo.pdf
 
DNA replikasyonundan geen bakterileri moleklleri izlemeni.pdf
DNA replikasyonundan geen bakterileri moleklleri izlemeni.pdfDNA replikasyonundan geen bakterileri moleklleri izlemeni.pdf
DNA replikasyonundan geen bakterileri moleklleri izlemeni.pdf
 
DNA exits mostly as a double stranded molecule Because of .pdf
DNA exits mostly as a double stranded molecule Because of .pdfDNA exits mostly as a double stranded molecule Because of .pdf
DNA exits mostly as a double stranded molecule Because of .pdf
 
Dk bir gerileme R2 u anlama gelir A sol taraftaki d.pdf
Dk bir gerileme  R2  u anlama gelir   A  sol taraftaki d.pdfDk bir gerileme  R2  u anlama gelir   A  sol taraftaki d.pdf
Dk bir gerileme R2 u anlama gelir A sol taraftaki d.pdf
 
Divisional Income Statements and Retum on fnvestment Analysi.pdf
Divisional Income Statements and Retum on fnvestment Analysi.pdfDivisional Income Statements and Retum on fnvestment Analysi.pdf
Divisional Income Statements and Retum on fnvestment Analysi.pdf
 
discussing Monopolies and Externalities Positive and Negati.pdf
discussing Monopolies and Externalities Positive and Negati.pdfdiscussing Monopolies and Externalities Positive and Negati.pdf
discussing Monopolies and Externalities Positive and Negati.pdf
 
Distinguish time clauses from conditions and name the types .pdf
Distinguish time clauses from conditions and name the types .pdfDistinguish time clauses from conditions and name the types .pdf
Distinguish time clauses from conditions and name the types .pdf
 

Último

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 

Último (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 

does anyone know how to type this in R What is the predicte.pdf

  • 1. does anyone know how to type this in R What is the predicted wage growth if unemployment is 2.50 and the economy is not in recession? (be sure to use single quotes when setting the value for economy) " that the code I used : model7 <- lm(wage_growth ~ unemployment + economy + unemployment:economy + I(unemployment^2) + I(unemployment^2):economy, data=economic) summary(model7) newdata <- data.frame(unemployment = 2.50 , economy='not in recession') print("prediction interval") prediction_pred_int <- predict(model7, newdata, interval="predict", level=0.90) round(prediction_pred_int,4) print("confidence interval") prediction_conf_int <- predict(model7, newdata, interval="confidence", level=0.90) round(prediction_conf_int,4) I think the line that is bold is the problem but I don't know how to fix it. that the error msg I keep getting : Error in model.frame.default(Terms, newdata, na.action = na.action, xlev = object$xlevels): factor economy has new level not in recession Traceback: 1. predict(model7, newdata, interval = "predict", level = 0.9) 2. predict.lm(model7, newdata, interval = "predict", level = 0.9) 3. model.frame(Terms, newdata, na.action = na.action, xlev = object$xlevels) 4. model.frame.default(Terms, newdata, na.action = na.action, xlev = object$xlevels) 5. stop(sprintf(ngettext(length(m), "factor %s has new level %s", . "factor %s has new levels %s"), nm, paste(nxl[m], collapse = ", ")), . domain = NA) bs in the example used in class the professor used this code: newdata <- data.frame(inflation=2.1, economy='recession')